All submissions for this problem are available.
Louie, Douie and Huie want to open a lemonade stall so that they can earn their pocket money. However, Uncle Scrooge being a skinflint miser, has refused to invest a single dime in their business. That’s the trouble with you young scalawags of today...you expect to start in the top instead of working up from the bottom, like I did!' was what Uncle Scrooge had to say on hearing of their brilliant plan.
The nephews start discussing alternative ways of obtaining the necessary capital.
Louie tells that he heard Gyro discussing the safety scheme of Scrooge's new piggy bank. The piggy bank has two locks which need to be supplied with positive numbers a and b with a < b which satisfy the condition a^ 2 + b^2- ab = the number on the safe.
Douie knows that Gyro issued a book on prime numbers from McDuck Library and checking with the book finds that the number on the safe is prime. He also finds out from the book that only primes of the form 3t+1 can be written in this form. Now it is up to you to help Huie to put a and b together and crack the safe to start the lemonade business.
Number of primes
The primes can have at most 10 digits.
Numbers a b (values separated by a single space and each line ends with a new line character)
Input: 1 7 Output: 7 2 3
|Time Limit:||50 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.