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 1807. Cartridges for Maxim

AC, but I think my solution is wrong
This test: 900660121

My solution printed 30011 30011 30011 510187 570209 690253 870319 930341 1110407 1230451 1290473 1410517 1470539 1590583 1770649 1830671 2010737 2130781 2190803 2370869 2430891 2490913 2670979 2911067 3031111 3091133 3211177 3271199 3391243 3631331 3751375 3811397 3841408 3931441 4111507 4171529 4471639 4531661 4711727 4891793 5011837 5071859 5191903 5371969 5431991 5732101 5792123 5912167 5972189 6332321 6692453 6812497 6872519 6992563 7172629 7232651 7532761 7712827 7892893 8072959 8132981 8313047 8433091 8493113 8793223 9213377 9333421 9393443 9513487 9933641 10113707 10413817 10473839 10593883 10773949 11014037 11194103 11374169 11494213 11674279 11914367 12034411 12274499 12574609 12634631 12934741 12994763 13174829 13294873 13474939 13715027 13835071 13895093 14015137 14375269 14615357 14735401 14975489 15095533 15275599 15695753 16235951 16416017 16716127 16896193 17076259

But I think that first two 30011 is better to substitute for 60022. Or where am I "stuping"? =)
Re: AC, but I think my solution is wrong
Posted by Sandro (USU) 2 Nov 2010 01:24
Both answers are correct.
Re: AC, but I think my solution is wrong
How? In the first case we don't have additional multiplier 2 in LCM, but in the second case we do!
Re: AC, but I think my solution is wrong
Posted by Victor Barinov (TNU) 2 Nov 2010 13:43
In first case you have even number 3841408
So both answers will have the same lcm.
Re: AC, but I think my solution is wrong
OMG, thank you! But now I don't understand how my code works... =)
Re: AC, but I think my solution is wrong
Posted by Victor Barinov (TNU) 2 Nov 2010 17:41
BTW, it seems that your output is wrong.
LCM =
1145572696929554701079627087188585278224797526867219882418294936208691318014731501909363309122622626756133318658525035985652955558442865786706238900113218934286831376065925560824507193167414120672919107758638356289823952045129094359452304000

but it is possible to get bigger lcm.