Cometin'

BOJ-2914 - Python

2020-08-16 at Algorithm category

n과 m을 입력받은 후 A를 구하면 된다. A / n이 m이지만 A / n에서 소수값이 있을 때 m은 +1한 정수가 되게 된다. n * (m-1) + 1 수식을 이용하여 풀었다.

n, m = map(int, input().split())
print(n * (m-1) + 1)

hyesungoh

Personal blog by hyesungoh.

I like to share my knowledge for those who wandering in issue.