Problem G
Yule Lads
The kids in Iceland are pretty lucky. Not only do they have
one Santa Claus, but
On a street in a small town in Iceland, there are
On each of the
However, some of the Yule Lads have been feeling sick, and did not come to town. On Christmas day all but the first house had their lights turned on. How many Yule Lads came to town?
Input
The first line of input contains a positive integer
Output
Output a single integer, the number of Yule Lads that came
to town. You can assume that there is only one scenario that
leads to all houses having their lights on except for house
number
Example
Consider the case
-
Six nights before Christmas, the Yule Lad will turn the lights at house
off. -
Five nights before Christmas, the Yule Lad will turn the lights at house
off. -
Four nights before Christmas, the Yule Lad will turn the lights at house
off. -
Three nights before Christmas, the Yule Lad will turn the lights at house
off, and the lights at house on. -
Two nights before Christmas, the Yule Lad will turn the lights at houses
and off, and the lights at house on. -
The night before Christmas, the Yule Lad will turn the lights at houses
and off, and the lights at houses , , and on.
However, house number
On the other hand, if only the Yule Lad that was supposed to
come into town four days before Christmas is sick, then all
lights, except for at house number
Grading
Your solution will be graded on a set of subtasks. A subtask will consist of multiple test cases. To get the points for a subtask, your solution must pass all test cases that are part of the subtask.
Subtask |
Score |
Constraints |
1 |
15 |
|
2 |
10 |
|
3 |
12 |
|
4 |
13 |
|
5 |
15 |
|
6 |
14 |
|
7 |
21 |
|
Sample Input 1 | Sample Output 1 |
---|---|
6 |
5 |
Sample Input 2 | Sample Output 2 |
---|---|
13 |
9 |
Sample Input 3 | Sample Output 3 |
---|---|
68 |
42 |
Footnotes
- An integer
is divisible by the integer if the division leaves no remainder.