Harry's and the lights

3.1

14 votes
Medium
Problem

It's the occasion of Deepawali and Harry is decorating his apartment with a light bulb set. The light bulb set is in series and has N bulbs placed in a sequence on a string which is programmed to change patterns every second. At any given instant of time, if at least one bulb in the set is on, how many different patterns of light can the serial light bulb set produce?

Note: Lighting two bulbs - is different from **-

Input Format The first line contains the number of test cases T, T lines follow. Each line contains an integer N, the number of bulbs in the serial light bulb set.

Output Format Print the total number of patterns modulo 10^5

Constraints

1 <= T <= 1000
0< N < 10^4

Sample Input

2
1
2

Sample Output

1
3

Explanation

Case 1: 1 bulb can be lit in only 1 way.

Case 2: 2 bulbs can be lit in -, *-, * i.e. 3 ways.

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?