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(pq) as follows:





   In this problem you have to calculate S(pq) 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(pq) on first line.

Samples                                  

Input

Output

1

1 10

46

2

10 20

 

48

 

3

30 40

52

 

Tayyorladi: Azat Yusupov
Text from: acm.sgu.ru