Logo
(追記) (追記ここまで)

33337번 - Even-dominant Numbers 다국어인터랙티브

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 2048 MB111100.000%

문제

This is an interactive problem.

Let $x$ be an even-dominant number if the total number of even decimal digits of $x$ and $\left\lfloor \sqrt{x} \right\rfloor$ (the decimal representation of the square root of $x,ドル rounded down to the nearest integer) is greater than the total number of odd decimal digits of these numbers.

For example, 222ドル,213円$ is an even-dominant number because the total number of even digits in 222ドル,213円$ and $\left\lfloor \sqrt{222,213円} \right\rfloor = 471$ is 5ドル,ドル which is greater than 4ドル,ドル the total number of odd digits. However, the number 2ドル$ is not an even-dominant number because the total number of even digits in 2ドル$ and $\left \lfloor \sqrt{2} \right \rfloor = 1$ is equal to the total number of odd digits.

Determine the number of even-dominant numbers in the segment $[\ell, r]$.

인터랙션 프로토콜

The jury's program outputs a sequence of queries, one after the other. Once the participant's program has printed an answer for a given query, the jury's program will proceed to output the next query.

입력

The first line contains one integer $t$ (1ドル \leq t \leq 10,円 000$): the number of queries.

Each of the next $t$ lines contains two integers $\ell_i$ and $r_i$ (1ドル \leq \ell_i \leq r_i \leq 10^{12}$) denoting the segment for the $i$-th query.

출력

For each query, print a line with a single integer: the number of even-dominant numbers in the given segment.

제한

예제 입력 1

1
1 10

예제 출력 1

3

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2023 > Day 2: Nyatl Contest 2023 E번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /