{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "4cf2d9c5-3215-467a-8907-034ece0de066",
"metadata": {},
"outputs": [],
"source": [
"from decimal import Decimal,getcontext\n",
"getcontext().prec = 1067\n",
"\n",
"fin=open(\"numere2.in\", \"r\").readline\n",
"fout=open(\"numere2.out\", \"w\").write\n",
"\n",
"n=int(fin())\n",
"a=67\n",
"i=340\n",
"while i>0:\n",
" a=int(Decimal(n)**(Decimal(1)/Decimal(i)))\n",
" if a**i==n:\n",
" break;\n",
" a+=1;\n",
" if a**i==n:\n",
" break;\n",
" i-=1\n",
"fout(str(a)+\"\\n\"+str(i))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}