beecrowd | 2867

Digits

By Ricardo Martins, IFSULDEMINAS BR Brazil

Timelimit: 1

Given two integers, n and m, how many digits have nm?

Examples:

2 and 10 - 210 = 1024 - 4 digits

3 and 9 - 39 = 19683 - 5 digits

Input

The input is composed of several test cases. The first line has an integer C, representing the number of test cases. The following C lines contain two integers N and M (1 <= N, M <= 100).

Output

For each input test case of your program, you must print an integer containing the number of digits of the result of the calculated power in the respective test case.

Input Sample Output Sample

4
1 1
2 10
3 9
100 100

1
4
5
201