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

19491번 - Equation 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB83393748.684%

문제

For a positive integer $n,ドル let $f(n)$ be the sum of squares of its digits in the decimal notation. Given are three integers $k, a, b$. Your task is to determine the number of such natural numbers $n,ドル that $a \le n \le b$ and $n$ is the solution of the equation \[ k\cdot f(n) = n. \]

입력

The first and only line of the input contains three integers of the task statement: $k, a, b,ドル (1ドル \le k, a, b \le 10^{18},ドル $a \le b$).

출력

Your program should output a single integer: the number of integral solutions of the given equation contained in the range $[a,b]$.

제한

예제 입력 1

51 5000 10000

예제 출력 1

3

힌트

In the example, the only positive integers $n$ from the range $[5000,10000]$ satisfying the equation for $k=51$ are 7293ドル,ドル 7854ドル$ and 7905ドル$.

출처

Camp > Petrozavodsk Programming Camp > Summer 2016 > Day 6: Warsaw U Contest, XVI Open Cup Onsite G번

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

출처

대학교 대회

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

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