3304 - Super Pow 3304 - Super Pow 3304 - Super Pow

Estadísticas Env: 140 | AC: 17 | %AC: 12,14 | Puntuación: 4,00
Creado por Isaac Vega Rodríguez
Adicionado por isaacvr (2015-06-03)
Límites
Tiempo Total: 10000 MS | Tiempo Caso: 2500 MS |Memoria: 256 MB | Salida límite (mb): 64 MB | Tamaño: 16 KB
Lenguajes activados
Disponible en

Descripción

Alice and Bob was talking about factorials and Alice, like always, proposed to Bob one interesting test. She said: "I go to give you thee numbers, a, b and c, and you will do this operation: first, you will calculate a!, b! and c!, after this you will calculate b! ^ c! and then, you will take this result (called d) and will calculate a! ^ d". Bob, thinking that this operation was small and easy, started trying with a=2, b=3 and c=2, he calculated a!, b! and c! that are 2, 6 and 2. Then, he calculated 6^2 = 36, but when he was trying to calculate 2^36, he realized that was very big this number, so he want your help to find this result.
Alice and Bob was talking about factorials and Alice, like always, proposed to Bob one interesting test. She said: "I go to give you thee numbers, a, b and c, and you will do this operation: first, you will calculate a!, b! and c!, after this you will calculate b! ^ c! and then, you will take this result (called d) and will calculate a! ^ d". Bob, thinking that this operation was small and easy, started trying with a=2, b=3 and c=2, he calculated a!, b! and c! that are 2, 6 and 2. Then, he calculated 6^2 = 36, but when he was trying to calculate 2^36, he realized that was very big this number, so he want your help to find this result.
Alice and Bob was talking about factorials and Alice, like always, proposed to Bob one interesting test. She said: "I go to give you thee numbers, a, b and c, and you will do this operation: first, you will calculate a!, b! and c!, after this you will calculate b! ^ c! and then, you will take this result (called d) and will calculate a! ^ d". Bob, thinking that this operation was small and easy, started trying with a=2, b=3 and c=2, he calculated a!, b! and c! that are 2, 6 and 2. Then, he calculated 6^2 = 36, but when he was trying to calculate 2^36, he realized that was very big this number, so he want your help to find this result.

Especificación de entrada

The first line contain a single number t that is the test cases (1 <= t <= 10^5). The next t lines contain three numbers, a, b and c, separated by a single space (0 <= a, b, c <= 10^6).
The first line contain a single number t that is the test cases (1 <= t <= 10^5). The next t lines contain three numbers, a, b and c, separated by a single space (0 <= a, b, c <= 10^6).
The first line contain a single number t that is the test cases (1 <= t <= 10^5). The next t lines contain three numbers, a, b and c, separated by a single space (0 <= a, b, c <= 10^6).

Especificación de salida

For each test in the input, you will give the result of the operation described above modulo 1000000007.
For each test in the input, you will give the result of the operation described above modulo 1000000007.
The first line contain a single number t that is the test cases (1 <= t <= 10^5). The next t lines contain three numbers, a, b and c, separated by a single space (0 <= a, b, c <= 10^6).

Ejemplo de entrada

1
2 3 2

Ejemplo de salida

719476260

Sugerencia(s)

The operation, mathematically speaking is a! ^ ( b! ^ c! ).
The operation, mathematically speaking is a! ^ ( b! ^ c! ).
The operation, mathematically speaking is a! ^ ( b! ^ c! ).

Recomendación

Hemos seleccionado cuidadosamente varios problemas similares: 3378 | 3377 | 2156 | 2243 | 3479 | 1811