2627 - JZPKIL

Input

第一行,询问个数T。   下面T行,每行三个整数,n, x, y。

Output

  T行,每行一个整数,表示相应的询问的答案

Examples

Input

5
6 0 0
6 0 1
6 1 0
6 1 1
1000000000 50 50

Output

6
66
15
126
393442025

数据规模和约定
  30%的数据,x=y
  另30%的数据,n<=10^9, x, y<=100
  100%的数据,T<=100, 1<=n<=10^18, 0<=x, y<=3000
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题