#R1014. [KBC001F] Class

[KBC001F] Class

Problem Statement

Little A is starting school! The first class he has is a math class. During the class, the teacher gave him a difficult problem:

Given a sequence aa, it is known that:

$a=\{\text{Round}(\sqrt{2},N),\text{Round}(\sqrt{3},N),\text{Round}(\sqrt{4},N),\cdots,\text{Round}(\sqrt{K},N)\}$

Here, Round(x,y)\text{Round}(x,y) represents rounding xx to yy decimal places.

Given N,K,XN,K,X, find:

  1. The sum of the number of occurrences of the decimal part XX in each element of this sequence.
  2. The sum of the digits of the decimal part in each element of this sequence.

Constraints

  • 1N2001 \leq N \leq 200
  • 1K10001 \leq K \leq 1000
  • 1X91 \leq X \leq 9

Input Format

The input is given from Standard Input in the following format:

$\color{#cccccc}\boxed{\color{white}{\large{|}}\color{black}N\ \ K\ \ X\color{white}{\large{|}}}$

Output Format

The output consists of two lines:

  • The first line is the sum of the number of occurrences of the decimal part XX in each element of the sequence.
  • The second line is the sum of the digits of the decimal part in each element of the sequence.

Sample Input 1

2 5 4

Sample Output 1

2
21

$\sqrt2\approx1.41,\sqrt3\approx1.73,\sqrt4=2,\sqrt5\approx2.24$.

4+1+7+3+2+4=214+1+7+3+2+4=21.