There are N students in a class, each in possession of a different funny story. As the students were getting bored in the class, they decided to come up with a game so that they can pass their time.
They want to share the funny stories with each other by sending electronic messages. Assume that a sender includes all the funny stories he or she knows at the time the message is sent and that a message may only have one addressee. What is the minimum number of messages they need to send to guarantee that everyone of them gets all the funny stories?
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each testcase contains an integer N denoting the number of students.
For each testcase, print the minimum number of messages they need to send to guarantee that everyone of them gets all the funny stories.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.