Back
Close

Sum of odd

Statement

 Goal

In this puzzle, you have to find out if it is possible to compute the number in input by summing at least two consecutive positive odd numbers.
Input
A single number n.
Output
Line 1: the number of valid solutions.
Line 2: first and last values of the longest sequence of consecutive odd numbers.
Constraints
n < 2^32
Example
Input
15
Output
1
3 7

Tags

Difficulty
Hard

Test cases
Test 1 Test
Input
15
Output
1 3 7

Validator 1 Validator
Input
21
Output
1 5 9

Test 2 Test
Input
1000
Output
4 31 69

Validator 2 Validator
Input
1001
Output
3 65 89

Test 3 Test
Input
1002
Output
0

Validator 3 Validator
Input
1006
Output
0

Test 4 Test
Input
8167415
Output
15 887 5783

Validator 4 Validator
Input
4962375
Output
23 471 4479

Test 5 Test
Input
96347128
Output
4 270283 270993

Validator 5 Validator
Input
94351168
Output
15 6433 20463

Test 6 Test
Input
2147483631
Output
7 23571 95631

Validator 6 Validator
Input
4294967295
Output
15 3 131071

Solution language

Solution

Stub generator input