Problem p03573 - Generation 2

Orig Description

Score : 100 points
Problem StatementYou are given three integers, A, B and C.
Among them, two are the same, but the remaining one is different from the rest.
For example, when A=5,B=7,C=5, A and C are the same, but B is different.
Find the one that is different from the rest among the given three integers.  
Constraints
-100 \leq A,B,C \leq 100 
A, B and C are integers.
The input satisfies the condition in the statement.
InputInput is given from Standard Input in the following format:  
A B C
OutputAmong A, B and C, print the integer that is different from the rest.
Sample Input 15 7 5
Sample Output 17
This is the same case as the one in the statement.
Sample Input 21 1 7
Sample Output 27
In this case, C is the one we seek.
Sample Input 3-100 100 100
Sample Output 3-100

Extracted Specification

An integer A (-100 ≤ A ≤ 100), an integer B (-100 ≤ B ≤ 100), and an integer C (-100 ≤ C ≤ 100).

### Example Input:

```
15 7 5
```

### Function Signature:
Write a function f(A, B, C) that takes in the input. 
def f(A: int, B: int, C: int): 
    ''' 
    A: an integer 
    B: an integer
    C: an integer
    '''

Test Case Generator

Sure, here is a test case generator for the given problem statement:

```python
import random

def tcgen():
    # Generate two identical integers
    identical_value = random.randint(-100, 100)
    
    # Generate a different integer
    different_value = identical_value
    while different_value == identical_value:
        different_value = random.randint(-100, 100)
    
    # Place the identical and different values in a random order
    values = [identical_value, identical_value, different_value]
    random.shuffle(values)
    
    return values

# Example usage:
for _ in range(5):
    print(tcgen())
```

### Explanation

1. We first generate a random integer `identical_value` that will be used for the two identical values.
2. We then generate another integer `different_value` that must be different from `identical_value`. We use a loop to ensure this condition.
3. We put the two identical values and the different value into a list called `values`.
4. We shuffle the `values` list to randomize the order of the three integers.
5. The function returns the list of values.

You can use the `tcgen()` function to generate random test cases for your problem statement. Each generated test case will meet the constraints and conditions specified in the problem statement.

Extract Arguments

def extract_arguments(fh):
    A, B, C = map(int, fh.readline().strip().split())
    return A, B, C