Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8821

Jo'natishlar soni: 714441

Muhokama yozuvlari: 4541

Yangiliklar soni: 98

Yangiliklar izohlari: 1174


So'ngi izohlar

754. Simple Addition
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

Let's define a simple recursive function F(n), where

: prb1517-1







   Let's define the function S(p, q) as follows:

: prb1517-2





   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

 

Tayyorladi: Azat Yusupov
Text from: acm.sgu.ru
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(24) Barcha urinishlar(122)