#K73397. Count Ways to Reach the Top
Count Ways to Reach the Top
Count Ways to Reach the Top
You are given a staircase with N steps. You can climb the staircase by taking either one step or two steps at a time. Your task is to compute the number of unique ways to reach the top of the staircase.
The problem can be formulated using the recurrence relation:
with the base cases:
Note: If N is less than or equal to 0, the answer is 0.
inputFormat
The input consists of a single integer N representing the number of steps in the staircase. The input is read from standard input (stdin).
outputFormat
Output a single integer representing the number of unique ways to reach the top of the staircase. The output should be printed to standard output (stdout).
## sample3
3