1552 我加,我加,我加加加


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

有2个正整数 a 和 n,(a>=0且可能不是个位数,1<=n<=19),求 a+aa+aaa+aa…a(n个a)之和,保证答案不超出int64范围。例如,输入 2 和 3,输出 246(2 + 22 + 222=246)。

Input

第一行为t(t<=10),表示存在多组数据。接下来有t组数据,每组数据包含正整数a和n。

Output

输出一行结果,格式见sample output。

Sample

Input

3
2 3
5 4
1 1

Output

sum = 246
sum = 6170
sum = 1

Hint

使用scanf("%I64d",&a)输入 使用printf("%I64d\n",x)输出


Source: Zsf


Comments

There are no comments at the moment.