Population
Time limit1sMemory limit1024 MB
Given a starting population and an elapsed time, the task asks for the population after that time, with one birth every 4 seconds and one death every 7 seconds.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
In Emily's country, a person dies every 7 seconds, and a person is born every 4 seconds. Given a beginning population, estimate the population after a certain period of time.
Input
The first line of input contains a single integer , the number of lines that follow. Each line contains two integers, and , where is the beginning population and is the amount of time that passes. Both and are between 1 and 2,000,000,000.
Output
Output the estimated population after the period of time based on the above statistics.