Submeter | Todas submissőes | Melhores | Voltar |
Problem hidden
FACVSPOW - Factorial vs Power |
Consider two integer sequences f(n) = n! and g(n) = an, where n is a positive integer. For any integer a > 1 the second sequence is greater than the first for a finite number of values. But starting from some integer k, f(n) is greater than g(n) for all n >= k. You are to find the least positive value of n for which f(n) > g(n), for a given positive integer a > 1.
Input
The first line of the input contains number t – the amount of tests. Then t test descriptions follow. Each test consist of a single number a.
Constraints
1 ≤ t ≤ 100000
2 ≤ a ≤ 106
Output
For each test print the least positive value of n for which f(n) > g(n).
Example
Input: 3 2 3 4 Output: 4 7 9
Adicionado por: | Spooky |
Data: | 2009-11-01 |
Tempo limite: | 1s |
Tamanho do fonte: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Linguagem permitida: | Todas exceto: ASM64 CLOJURE ERL FSHARP NODEJS OBJC PERL6 PY_NBC SCALA SQLITE TCL VB.NET |
Origem: | Advancement Autumn 2009, http://sevolymp.uuuq.com/ |