#P31. [KBC001F] Class
[KBC001F] Class
Source
This problem is adapted from Long Long OJ. All rights reserved.
Description
Alice went to the seventh grade today! The first class Alice had is a Maths class. During the class, the teacher gave him a difficult problem:
Given a sequence , 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, represents rounding to decimal places.
Given , find:
- The sum of the number of occurrences of the decimal part in each element of this sequence.
- The sum of the digits of the decimal part in each element of this sequence.
Input
One line consisting of three integers .
Output
The output consists of two lines:
- The first line is the sum of the number of occurrences of the decimal part 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.
Samples
2 5 4
2
21
Tips
Sample Explanation:
$\sqrt2\approx1.41,\sqrt3\approx1.73,\sqrt4=2,\sqrt5\approx2.24$.
.
- .
- .
- .