A. Greatest Convex
You are given an integer \(k\). Find the largest integer \(x\), where \(1≤x † \(y!\) denotes the factorial of \(y\), which is defined recursively as \(y!=y⋅(y−1)!\) for \(y≥1\) with the base case of \(0!=1\). For example, \(5!=5⋅4⋅3⋅2⋅1⋅0!=120\). ‡ If \(a\) and \(b\) are integers, then \(a\) is \(a\) multiple of \(b\) if there exists an integer \(c\) such that \(a=b⋅c\). For example, \(10\) is a multiple of \(5\) but \(9\) is not a multiple of \(6\). InputThe first line contains a single integer \(t\) \((1≤t≤10^4)\) — the number of test cases. The description of test cases follows. The only line of each test case contains a single integer \(k\) \((2≤k≤10^9)\). OutputFor each test case output a single integer — the largest possible integer \(x\) that satisfies the conditions above. If no such \(x\) exists, output \(−1\). Exampleinput 436810 output 2579 NoteIn the first test case, \(2!+1!=2+1=3\), which is a multiple of \(3\). In the third test case, \(7!+6!=5040+720=5760\), which is a multiple of \(8\). 原题链接 给出\(t\)个\(k\),找出是否存在一个\(x\)满足\(1≤x(相关资料图)
简述题意
思路
代码
点击查看代码
#include
解题历程
经验总结
原因