시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 445 322 297 75.000%

문제

모든 사람은 취미를 가지고 있다 그것은 철수에게도 예외는 아니였다. 그는 쿠키를 너무 좋아해서 세상이 어떻게 돌아가는지도 모른다. 만약 당신이 쿠키를 본다면 당신은 그곳에서 철수를 찾을 수 도 있을 정도이다. 그러나 불행하게도 그는 그가 그의 쿠키를 어떻게 먹었는지를 기억하지못한다. 그가 만약에 C개 이상의 쿠키를 가진다면, 그는 C개의 쿠키를 그 날 먹는다. 그렇지 않다면, 그는 있는 쿠키를 전부 먹는다. 그에게 쿠키 N개가 남아있을 때  그는 얼마나 많은 날동안 최소한 한개이상의 쿠키를 먹었을지를 구하라

입력

첫번째 줄에는 T 개의 테스트 갯수가 주어진다 각각의 테스트케이스에는 N 과 C 의 숫자가 주어진다 N은 그가 가진 쿠키의 갯수이고  C 는 그가 매일 먹는 쿠키의 갯수이다.

  • 0 < T < 100
  • 0 < N < 1000000000
  • 0 < C < 5000

출력

각각의 테스트케이스에서 철수가 쿠키를 먹은 날이 얼마나 되는지를 출력하시오.

예제 입력 1

2
6 2
10 3

예제 출력 1

3
4
W3sicHJvYmxlbV9pZCI6IjExMTM0IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjZmUwXHVkMGE0XHVjNTYwXHVkNjM4XHVhYzAwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWJhYThcdWI0ZTAgXHVjMGFjXHViNzhjXHVjNzQwIFx1Y2RlOFx1YmJmOFx1Yjk3YyBcdWFjMDBcdWM5YzBcdWFjZTAgXHVjNzg4XHViMmU0IFx1YWRmOFx1YWM4M1x1Yzc0MCBcdWNjYTBcdWMyMThcdWM1ZDBcdWFjOGNcdWIzYzQgXHVjNjA4XHVjNjc4XHViMjk0IFx1YzU0NFx1YjJjOFx1YzYwMFx1YjJlNC4gXHVhZGY4XHViMjk0IFx1Y2ZlMFx1ZDBhNFx1Yjk3YyBcdWIxMDhcdWJiM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출처

Contest > IDI Open Contest > IDI Open 2010 G번

  • 문제를 번역한 사람: dtc03012
  • 문제의 오타를 찾은 사람: koosaga