시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
3 초 256 MB 536 419 373 81.264%

문제

N부터 M까지의 수들을 종이에 적었을 때 종이에 적힌 0들을 세는 프로그램을 작성하라.

예를 들어, N, M이 각각 0, 10일 때 0을 세면 0에 하나, 10에 하나가 있으므로 답은 2이다.

입력

첫 번째 줄에 테스트 케이스의 수 T가 주어진다.

각 줄에는 N과 M이 주어진다.

  • 1 ≤ T ≤ 20
  • 0 ≤ N ≤ M ≤ 1,000,000

출력

각각의 테스트 케이스마다 N부터 M까지의 0의 개수를 출력한다.

예제 입력 1

3
0 10
33 1005
1 4

예제 출력 1

2
199
0
W3sicHJvYmxlbV9pZCI6IjExMTcwIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiMFx1Yzc1OCBcdWFjMWNcdWMyMTgiLCJkZXNjcmlwdGlvbiI6IjxwPk5cdWJkODBcdWQxMzAgTVx1YWU0Y1x1YzljMFx1Yzc1OCBcdWMyMThcdWI0ZTRcdWM3NDQgXHVjODg1XHVjNzc0XHVjNWQwIFx1YzgwMVx1YzVjOFx1Yzc0NCBcdWI1NGMgXHVjODg1XHVjNzc0XHVjNWQwIFx1YzgwMVx1ZDc4YyAwXHViNGU0XHVjNzQ0IFx1YzEzOFx1YjI5NCBcdWQ1MDRcdWI4NWNcdWFkZjhcdWI3YThcdWM3NDQgXHVjNzkxXHVjMTMxXHVkNTU4XHViNzdjLjxcL3A+XHJcblxyXG48cD5cdWM2MDhcdWI5N2MgXHViNGU0XHVjNWI0LCBOLCBNXHVjNzc0IFx1YWMwMVx1YWMwMSAwLCAxMFx1Yzc3YyBcdWI1NGMgMFx1Yzc0NCBcdWMxMzhcdWJhNzQgMFx1YzVkMCBcdWQ1NThcdWIwOTgsIDEwXHVjNWQwIFx1ZDU1OFx1YjA5OFx1YWMwMCBcdWM3ODhcdWM3M2NcdWJiYzBcdWI4NWMgXHViMmY1XHVjNzQwIDJcdWM3NzRcdWIyZTQuPFwvcD5cclxuIiw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