Problem 3

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.
Input
Number of primes
The primes can have at most 10 digits.
Output
Numbers a b (values separated by a single space and each line ends with a new line character)
Example
Input: 1 7 Output: 7 2 3
Author:  vishesh_sigma 
Tags  vishesh_sigma 
Date Added:  28012010 
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 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 