본문 바로가기

백준 파이썬 코딩

백준 25425 운동회 파이썬

https://www.acmicpc.net/problem/25425

 

25425번: 운동회

첫째 줄에 $N, M, a, K$가 공백으로 구분되어 입력된다. $(1 ≤ N,M ≤ 10^9, 1 ≤ a ≤ N×M, 1≤ K ≤ M, K ≤ a)$

www.acmicpc.net

 

n,m,a,k = map(int,input().split())
t=(a-k) #t는 준혁이 팀을 제외한 남은 인원
if t/n>=1:
    maxs = n #남은 인원 << 참가 팀이니 n등까지 가능
else:
    maxs = t+1 #모든 팀이 한명 이상 살아있다는 소리이니 t+1등이 가능함
if float(int(t/m))==t/m: #t/m이 딱 나눠떨어지는지 확인하는 작업 
    mins= int(t/m)+1 #그냥 int(t/m)+1
else:#
    mins =int(t/m)+2 #올림하고 +1 ->int(t/m)+ 1+1
print(maxs,mins)