시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 505 361 333 73.673%

문제

모든 사람은 취미를 가지고 있다 그것은 철수에게도 예외는 아니였다. 그는 쿠키를 너무 좋아해서 세상이 어떻게 돌아가는지도 모른다. 만약 당신이 쿠키를 본다면 당신은 그곳에서 철수를 찾을 수 도 있을 정도이다. 그러나 불행하게도 그는 그가 그의 쿠키를 어떻게 먹었는지를 기억하지못한다. 그가 만약에 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
W3sicHJvYmxlbV9pZCI6IjExMTM0IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjZmUwXHVkMGE0XHVjNTYwXHVkNjM4XHVhYzAwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWJhYThcdWI0ZTAgXHVjMGFjXHViNzhjXHVjNzQwIFx1Y2RlOFx1YmJmOFx1Yjk3YyBcdWFjMDBcdWM5YzBcdWFjZTAgXHVjNzg4XHViMmU0IFx1YWRmOFx1YWM4M1x1Yzc0MCBcdWNjYTBcdWMyMThcdWM1ZDBcdWFjOGNcdWIzYzQgXHVjNjA4XHVjNjc4XHViMjk0IFx1YzU0NFx1YjJjOFx1YzYwMFx1YjJlNC4gXHVhZGY4XHViMjk0IFx1Y2ZlMFx1ZDBhNFx1Yjk3YyBcdWIxMDhcdWJiMzQ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zViNCJ9XQ==

출처

Contest > IDI Open Contest > IDI Open 2010 G번

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