Problem p03609 - Generation 3

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 other quantity.

### 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

Certainly! Here is a test case generator for the provided problem statement:

```python
import random

def tcgen():
    X = random.randint(1, 10**9)
    t = random.randint(1, 10**9)
    
    return X, t

# Example usage:
if __name__ == "__main__":
    test_case = tcgen()
    print(test_case)
```

This code snippet generates random test cases for the given problem statement. The function `tcgen()` generates two random integers \(X\) and \(t\) within the given constraints (1 ≤ \(X\) ≤ 10^9 and 1 ≤ \(t\) ≤ 10^9).

You can use this generator to produce multiple test cases for thorough testing of your solution. Here is how the output might look:

```
(1000000000, 1000000000)
(48, 58)
(100, 17)
```

You can run this generator multiple times to produce different test cases each time.

Extract Arguments

def extract_arguments(fh):
    X, t = map(int, fh.readline().strip().split())
    return X, t