본문 바로가기

매일매일 (Everyday)

[BOJ] - 기본 수학 1 - (2) - Python

2869: 달팽이는 올라가고 싶다

import sys
a, b, v = map(int, input().split())
counts = 1
if (v-a) / (a-b) == (v-a) // (a-b) :
    counts += ((v-a) // (a-b))
    print(counts)
else :
    counts += ((v - a) // (a - b)) + 1
    print(counts)

 

10250: ACM 호텔

T = int(input())
for _ in range(T):
    H, W, N = map(int, input().split())
    row = 1
    col = 1
    for _ in range(N-1):
        row += 1
        if row > H :
            row = 1
            col += 1
        else :
            continue
    print(row*100+col)

 

2839: 설탕 배달

N = input()
N = int(N)

ans = 0

while N >= 0 :
    if N % 5 == 0 :
        ans += (N // 5)
        print(ans)
        break
    
    N -= 3
    ans = ans + 1
else :
    print(-1)

 

10757: 큰 수 A+B

import sys
A, B = map(int, sys.stdin.readline().split())
print(A+B)