Category
Similar Problems
0754. Simple Addition
Time limit : 1000 ms
Memory limit : 64 mb
Let's define a simple recursive function F(n), where
Let's define the function S(p, q) as follows:
In this problem you have to calculate S(p, q) on given values of p and q.
Input
First line contains two nonnegative integers p and q (0≤p ≤ q≤2∙109), separated by space.
Output
Print the value S(p, q) on first line.
Samples
№ |
Input |
Output |
1 |
1 10 |
46 |
2 |
10 20
|
48
|
3 |
30 40 |
52 |
Text from: acm.sgu.ru