50/50

3

1 votes
Problem

It is lunch time at the Vibrant Gujarat Summit and all the investors are called for the executive lunch. When Bruce reached the lunch area, he found that the waiter was taking out bowls from a big box containing some amount of golden bowls and other bronze bowls. The bowls were taken out at random. Each dish contains exactly one bowl. Bruce and Robin are the first ones to receive the dishes.

Bruce believes that there is a 50/50 chance in everything. He tells Robin that the there is a 50% chance of both of them receiving a golden bowl. Robin is confused and doesn't know how is that possible. He asks Bruce what makes him think so. Bruce says that he would have to find the answer himself and so in order to make things interesting he tells Robin the total number of bowls the waiter has in the box. All Robin has to do is now find the number of golden bowls there should be in the box in order for it to be a 50% probability.

Input: Only one integer number, N, telling the number of bowls in the box.

Output: The number of golden bowls required for it to be a 50% probability of both of them receiving a golden bowl.

Constraints: 1<= N <= 10^15

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

As Bruce and Robin are the first ones to receive the bowls, if there are 15 golden bowls then the probability for the first person to get a golden one is 15/21 and the second one is 14/20.

(15/21)*(14/20) = 0.5

Editor Image

?