ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1023. Buttons

why this code correct and more than, so fast?
Posted by xMagGTU Дмитрий Тишкин GPRS 19 May 2007 23:54
var i,k:longint;
begin
 read(k);
 i:=k div 3;
 while(k mod i<>0) do
   i:=k div(k div i +1);
write(k div i-1);
end.


Edited by author 19.05.2007 23:58
Re: why this code correct and more than, so fast?
Posted by Nickolas Kakà 6 Apr 2008 20:25
So fabulous.
Re: why this code correct and more than, so fast?
Posted by AlexeyPechenin 4 Oct 2008 20:21
Excellent... After you found maximal divider of K you can found minimal devider of K.... Excellent solution...
Re: why this code correct and more than, so fast?
Posted by Gora 27 Apr 2011 02:00
Explain this solution, please.
I'm a beginning programmer, so I can't understand.