A. Prison Break | Round #709 Div.2

LONGNEW·2021년 8월 12일
0

CP

목록 보기
78/155

https://codeforces.com/contest/1484/problem/A
시간 1초, 메모리 256MB

input :

  • t (1 ≤ t ≤ 100)
  • a b (1 ≤ a, b ≤ 100)

output :

  • For each test case print the single integer on a separate line — the answer to the problem.
    각 테스트 케이스에서 하나의 정수를 출력하시오.

조건 :

  • Michael wants to be able to get out of the prison after this, no matter which cell he is placed in. However, he also wants to break as few walls as possible.
    Michael은 교도소의 어떤 방에 들어가든 탈옥을 하고 싶어 합니다. 그래서 벽을 최소한으로 부술 수 있길 원합니다.

  • Your task is to find out the smallest number of walls to be broken so that there is a path to the outside from every cell after this.
    외부로 탈출할 수 있도록 하려 할 때 부숴야 하는 가장 적은 수의 벽을 찾아야 한다.


어떻게든 각 위치에서 외부와 연결되게 하려면 모든 위치에서 최소한 하나의 벽은 부숴야 한다.
그렇게 되면 그냥 입력 받은 두 수를 곱한다면 그 수를 얻을 수 있다.

import sys

for _ in range(int(sys.stdin.readline())):
    a, b = map(int, sys.stdin.readline().split())

    print(a * b)

0개의 댓글