Given an integer **n**, the task is to find whether n can be written as sum of three consecutive integer.

**Input:**

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.

**Output:**

For each testcase, if it is possible to write as a sum of three consecutive integers then print three consecutive integer, else print “-1”.

**Constraints:**

1<=T<=100

1<=N<=10000

**Example:**

**Input:**

2

6

7

**Output:**

1 2 3

-1

Explanation:

Testcase 1: N = 6 can be written as 1+2+3.

Testcase 2: N = 7 can be written as a sum of three consecutives.

Author: Sahil_Chhabra

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.

mrsaiteja2 | 73 |

Aravind^Pandit | 60 |

RajaRajput | 59 |

Aaaaarohiiii | 48 |

abhivick07 | 46 |

ARUN_PUNDIR | 609 |

manishgupta8497 | 607 |

Abhimanyu_kumar | 507 |

KhyatiSoneji | 501 |

vvggfggcg | 453 |

blackshadows | 5333 |

Ibrahim Nash | 5221 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4567 |

Login to report an issue on this page.