404394: GYM101492 K Cutting Strings
Memory Limit:512 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
K. Cutting Stringstime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output
Alice, Beto, and Carlos are playing with twine. Alice starts by pulling taut the string of twine, then she folds it and holds the string at the fold. Beto holds the loose ends on the other side. They then repeat the following procedure. Carlos cuts the string with scissors, thus separating Alice and Beto. Alice, without letting go of the strings she was holding, grabs the loose ends of the strings held by Beto and he does the same to the loose ends of the strings held by Alice.
How many separate strings will they have after the procedure is repeated K times?
InputThe input has a single integer, K.
- 0 ≤ K ≤ 30
The output has a single integer, the amount of separate strings at the end of the process.
ExamplesInput0Output
1Input
1Output
3