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

Estatísticas Env: 140 | AC: 17 | %AC: 12,14 | Pontoação: 4,00
Criado por Isaac Vega Rodríguez
Adicionado por isaacvr (2015-06-03)
Límiteis
Tempo Total: 10000 MS | Tempo Caso: 2500 MS |Memória: 256 MB | Saída límite (mb): 64 MB | Tamanho: 16 KB
Lenguagens activados
Disponivel em

Descripção

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.

Especificação 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).

Especificação de saída

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).

Exemplo de entrada

1
2 3 2

Exemplo de saída

719476260

Sugestões(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! ).

Recomendação

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