Orig Description
Score : 100 points
Problem StatementWe have a sandglass that runs for X seconds. The sand drops from the upper bulb at a rate of 1 gram per second. That is, the upper bulb initially contains X grams of sand.
How many grams of sand will the upper bulb contains after t seconds?
Constraints
1≤X≤10^9
1≤t≤10^9
X and t are integers.
InputThe input is given from Standard Input in the following format:
X t
OutputPrint the number of sand in the upper bulb after t second.
Sample Input 1100 17
Sample Output 183
17 out of the initial 100 grams of sand will be consumed, resulting in 83 grams.
Sample Input 248 58
Sample Output 20
All 48 grams of sand will be gone, resulting in 0 grams.
Sample Input 31000000000 1000000000
Sample Output 30
Extracted Specification
An integer X (1 ≤ X ≤ 10^9), representing some quantity.
An integer t (1 ≤ t ≤ 10^9), representing some duration or time.
### Example Input:
```
100 17
```
### Function Signature:
Write a function f(X, t) that takes in the input.
def f(X: int, t: int):
'''
X: an integer
t: an integer
'''
Test Case Generator
Sure! Here's a test case generator for the given problem statement:
```python
import random
def tcgen():
# Constraints
X = random.randint(1, 10**9)
t = random.randint(1, 10**9)
return X, t
# Example of generating a test case
if __name__ == "__main__":
X, t = tcgen()
print(X, t)
```
This generator function will produce random values for \(X\) and \(t\) within the given constraints (1 ≤ \(X\) ≤ 10^9 and 1 ≤ \(t\) ≤ 10^9). When you run the code, it will print a randomly generated test case in the format required by the problem statement.
Extract Arguments
def extract_arguments(fh):
X, t = map(int, fh.readline().strip().split())
return X, t