NDIVPHI  N DIV PHI_N
Given an integer N <= 10^{40} find the smallest m <= N such that m/phi(m) is maximum.
Input
N_{1}
N_{2}
.
.
.
N_{20}
Output
m_{1}
m_{2}
.
.
.
m_{20}
Example
Input: 10 . .
Output: 6 . .
hide comments
ubot:
20190313 03:25:03
i am comparing numbers after each successive multiplication, but the given order is of 10^40, which makes it impossible for me to compare, what is the workaround for that? Last edit: 20190313 03:29:36 

infinity_01:
20180826 16:46:07
the input format is not specified correctly Last edit: 20180901 16:02:07 

akshat_pat:
20180104 11:49:38
Finally AC !


sheldont:
20170625 11:49:47
cakewalk with python..


invincible_rm:
20160626 13:29:49
Awesome !!


Ayush Agarwal:
20140928 18:31:20
python is awesome


Bharath Reddy:
20140924 05:40:08
Take care of the case when n = 1 

saket diwakar:
20130126 00:45:13
python is awesome....:) 

Samuel Shen:
20120603 13:10:03
i have checked everything...its giving me correct answers for all n.....and time limit is also within 1 sec....even then TLE.....anyone plz help.... 

bashrc is back:
20110630 16:03:13
haskell friendly problem

Added by:  Frank Rafael Arteaga 
Date:  20100422 
Time limit:  0.142s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS OBJC PERL6 SQLITE VB.NET 
Resource:  ProjectEuler 