eolymp
bolt
Try our new interface for solving problems
Məsələlər

Game cards

Game cards

Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB

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?

Giriş verilənləri

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.

Nümunə

Giriş verilənləri #1
72
Çıxış verilənləri #1
39 21 12
Giriş verilənləri #2
73
Çıxış verilənləri #2
-1
Mənbə Dnipro Open School Olympiad in Informatics 2020