AGPC01G – Eat Pray Love Solution

0
11
SPOJ Solution

AGPC01G Statement

One of your friends was in relationship with multiple people at once and it didn’t end very well. Thus he/she chose the path of righteousness and decided to stay in only one relationship or stay single. But not only that, he/she became a motivational speaker and formed an organization to help people to walk through this path.

N people joined his/her organization. He/She takes one person and he/she either pairs that person up with another person in a relationship or keeps that person single. Let’s assume that every person can be paired up with every other person. In how many ways he/she can do that?

Input

First line of input will be T (1<= T <= 100000), denoting the number of test cases.

Next T lines will contain one integer N (1<= N <= 100000) per line.

Output

For each test case print correct answer describe in the description. As, output can be large. Print it modulo 1000000007.

AGPC01G  Slution

May you like to see:

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.