시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
3 초 256 MB 499 386 344 80.374%

문제

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+XHJcblxyXG48cD5cdWM2MDhcdWI5N2MgXHViNGU0XHVjNWI0LCBOLCBNXHVjNzc0IFx1YWMwMVx1YWMwMSAwLCAxMFx1Yzc3YyBcdWI1NGMgMFx1Yzc0NCBcdWMxMzhcdWJhNzQgMFx1YzVkMCBcdWQ1NThcdWIwOTgsIDEwXHVjNWQwIFx1ZDU1OFx1YjA5OFx1YWMwMCBcdWM3ODhcdWM3M2NcdWJiYzBcdWI4NWMgXHViMmY1XHVjNzQwIDJcdWM3NzRcdWIyZTQuPFwvcD5cclxuIiwiaW5wdXQi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