Question: C Programming Language Bibi would like to play a game, in this game Bibi decides a number X from 1 to a billion (1,000,000,000) inclusive.
C Programming Language
Bibi would like to play a game, in this game Bibi decides a number X from 1 to a billion (1,000,000,000) inclusive. Then the other player throws a dice, if the result is equal or higher than X, they win, otherwise they lose. Now, Jojo spectated the whole game but Jojo did not know what number X did Bibi decided to use. However, Jojo knows that Bibi is a lazy person so she never change her number X in one series of game. Jojo is curious, what is the lowest number and highest number could Bibi have chosen?
Format Input The first line of input consists of an integer N, the number of games in the series. The next N lines consists of two integer ai and bi , the dice roll and the result of the roll. If the result is 1, the other player win, if the result is 0, they lose.
Format: Output Print the lowest number and highest number Bibi could have chosen separated by a space.
Constraints: 1 <= N <= 100,000
1 <= a^1 <= 1,000,000,000
0 <= b^1 <= 1
Sample Input | Sample Output
5 |
30 1 |
53 1 |
2 0 |
21 1 |
8 0 | 9 21
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
