Flowers and Petals
Practice
0 (0 votes)
Medium Hard
Problem
75% Success 33 Attempts 50 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Ned has free time so he decide to play a game.In this game he take a random flower with n petals.He numbers the petals from 1 to n and pluck each petal until all the petals are fallen.He start with the first petal(petal with number 1),pluck it leaves the next and again pluck another and again leaves the next one and pluck another. He do it again an again until all the petals are plucked from the flower.

Input:

First line contains t, number of test cases.

Each t lines conatin n (number of petals).

Output:

Petal number plucked in the end of the game.

Constaints

1<=T<=10

2<=n<10^10

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:50
6 votes
Tags:
Special NumbersCountingMathamaticsMathC++
Editorial

No editorial available for this problem.