Given an integer n, the task is to find whether n can be written as sum of three consecutive integer.
The first line of the input contains a single integer T, denoting the number of test cases. Then T test case follows, a single line of the input containing a positive integer N.
For each testcase, if it is possible to write as a sum of three consecutive integers then print three consecutive integer, else print “-1”.
1 2 3
Testcase 1: N = 6 can be written as 1+2+3.
Testcase 2: N = 7 can be written as a sum of three consecutives.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.