Game cards
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Three boys (Peter, Ivan and Anatoly) were sharing N playing cards. First, Peter gave Ivan and Anatoly as many cards as they had. Then Ivan gave Anatoly and Peter as much as they had. And finally, Anatoly gave Peter and Ivan as much as each of them had at that time. In the end, everyone got the same. How many cards did each of them have first?
Input
The program enters one natural number from the keyboard: N - the total number of cards (do not exceed 2020).####OutputIn a single line, write three integers separated by a space - the number of cards that Peter, John and Anatoly had at first. If for the given value N the problem has no solution, output one number -1.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 1K
Acceptance rate 28%