这道题先是用数学公式可以推出来一个式子,接下来就是大数,,,碰到好几次大数了,以前都是用c或c++写的,这道题用c或c++实在是太麻烦,于是一咬牙,一跺脚,硬着头皮看起了Java,上午看了一点,下午问了问xd一些基本语法,于是便开始写了,既借助网上代码,又不断的问xd,终于ac了,这叫一个不容易啊,,用Java写的第一道题啊,,,,接下来再练一下Java,把nyoj上的大数题用Java再做一遍。。。。。。题目:
Euler's Totient function, φ (n) [sometimes called the phi function], is used to determine the number of numbers less than n which are relatively prime to n . For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and relatively prime to nine, φ(9)=6.
HG is the master of X Y. One day HG wants to teachers XY something about Euler's Totient function by a mathematic game. That is HG gives a positive integer N and XY tells his master the value of 2<=n<=N for which φ(n) is a maximum. Soon HG finds that this seems
a little easy for XY who is a primer of Lupus, because XY gives the right answer very fast by a small program. So HG makes some changes. For this time XY will tells him the value of 2<=n<=N for which n/φ(n) is a maximum. This time XY meets some difficult because
he has no enough knowledge to solve this problem. Now he needs your help.
Input
There are T test cases (1<=T<=50000). For each test case, standard input contains a line with 2 ≤ n ≤ 10^100.
Output
For each test case there should be single line of output answering the question posed above.
Sample Input
Sample Output
ac代码:
分享到:
相关推荐
ACM/ICPC亚洲预赛成都赛区网络赛真题,分享给广大热衷于ACM的人们们!
2022年第29届ACM国际大学生程序设计竞赛亚洲预赛上海赛区竞赛.doc
第33届ACM-ICPC亚洲区预赛(成都网络赛)题目 pdf格式
本资源为第46届ICPC国际大学生程序设计竞赛亚洲区预赛 上海站 正式赛题目,比赛时长一共五小时,题目为全英文题目,并且在比赛的时候可以使用一切纸质书籍,但禁止使用电子产品,一组三个队员,只允许使用一台电脑,...
好东西哟~~~ 是ACM比赛题目喔!!
2021年全国高中数学联赛广西赛区预赛试题及答案.pdf
2020年中学生生物学联赛预赛(安徽赛区)试题卷.doc
数学联赛天津赛区预赛试卷 试题.doc
生生物学联赛预赛(安徽赛区)试题卷 试题.doc
2015年全国高中数学联赛天津赛区预赛.caj
高中数学联赛预赛(陕西赛区)试题(扫描版) 试题.doc
高中数学联赛预赛(重庆赛区)试题(扫描版) 试题.doc
高中数学联赛预赛(江西赛区)试题(扫描版) 试题.doc
高中数学联赛预赛(吉林赛区)试题(扫描版) 试题.doc
高中数学联合竞赛预赛(湖北赛区)试题(扫描版) 试题.doc
全国高中数学联赛安徽赛区预赛试卷及详细答案.pdf
2021年全国高中数学联赛贵州赛区预赛试题(解析版).pdf
数学联赛陕西赛区预赛试卷 试题.doc
数学联赛江西赛区预赛试卷 试题.doc