시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 608 449 417 75.681%

문제

철수는 쿠키를 세상에서 제일 좋아한다. 쿠키가 있는 곳이라면 철수도 반드시 있다고 할 정도이다. 철수는 날마다 자신이 가지고 있는 쿠키 중 C개를 먹는다. C개 미만의 쿠키가 남아 있다면 전부 먹는다. 철수가 쿠키 N개를 가지고 있으면 며칠 동안 먹을 수 있는지 구하시오.

입력

첫 번째 줄에는 테스트케이스의 개수 T가 주어진다. 그 다음 줄부터 T개의 줄에 테스트케이스가 한 줄씩 주어진다. 테스트케이스는 철수가 가진 쿠키의 개수 N과 날마다 먹는 쿠키의 개수 C로 이루어져 있다.

출력

각 테스트케이스마다 한 줄씩 철수가 며칠 동안 쿠키를 먹을 수 있는지 출력한다.

제한

  • 0 < T < 100
  • 0 < N < 1,000,000,000
  • 0 < C < 5,000

예제 입력 1

2
6 2
10 3

예제 출력 1

3
4
W3sicHJvYmxlbV9pZCI6IjExMTM0IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjZmUwXHVkMGE0XHVjNTYwXHVkNjM4XHVhYzAwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWNjYTBcdWMyMThcdWIyOTQgXHVjZmUwXHVkMGE0XHViOTdjIFx1YzEzOFx1YzBjMVx1YzVkMFx1YzExYyBcdWM4MWNcdWM3N2MgXHVjODhiXHVjNTQ0XHVkNTVjXHViMmU0LiBcdWNmZTBcdWQwYTRcdWFjMDAgXHVjNzg4XHViMjk0IFx1YWNmM1x1Yzc3NFx1Yjc3Y1x1YmE3NCBcdWNjYTBcdWMyMThcdWIzYzQgXHViYzE4XHViNGRjXHVjMmRjIFx1Yzc4OFx1YjJlNFx1YWNlMCBcdWQ1NjAgXHVjODE1XHViM2M0XHVjNzc0XHViMmU0LiBcdWNjYTBcdWMyMThcdWIyOTQgXHViMGEwXHViOWM4XHViMmU0IFx1Yzc5MFx1YzJlMFx1Yzc3NCBcdWFjMDBcdWM5Y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