fork(3) download
  1. x = int(input())
  2. a=0
  3. b=10
  4. while x > 0:
  5. d = x % 6
  6. if d > a:
  7. a = d
  8. if d < b:
  9. b = d
  10. x = x // 6
  11. print(a*b)
  12.  
Success #stdin #stdout 0.01s 7392KB
stdin
166671186872651790542718665611602190470821349019056231465050892743397173688326681587673654641335849838139804808699341864853467525297630484677352865777913060310717500049552958627387434281777176345715523196582708412945223102496628632917566976580733499540911870651802286237402268631133823187016836930421780845762497131040243467785022417124622964424030943303497621272148601699712136182029099739635508503633961624304381997571675439881337118218998257963108239282291473220743011707009878974580127837204884356977374627822968755421706868729754010417413369055819548419071855958006860703882716442233077814628116292250443258657318224364061384325626536726456030621832375445153389927424828549063483118136359827441994531489341104461565691767977727030355816060077438604948482396644480585730484541253822950565310810646819067688910589929550536004072753244748639195895413820145247789729658762227933324014639290829170580295287006377576464900680982522042604121065937072856928528146623019183937474830965444498592827834551724793438788929986213915929802621279141760962101719944035813345914618531337342374258131350183840515978963419117218012682854986082728761093823387643222921794497260512568429628219463741135969351377296011421746290073862906452522241469553296824417557188799711828059226374782216401607835018469879546446406446469558677735088226120103425416105880475190445404086717898677965050009036609805525006404895814862204659423859993430433144617567037647413528957086797903279981717756554037370232240647230282916373682925777747662983443928147377077190629544606038928355414679112683169083755055889471666632818060511990286218884536775549192075796075614409217719459855355502665143060329957309247356318565929166493444435417343326640794531650575860450880919874245815742709914809404924770867320054209075035327308289594186052728537541134
stdout
12