uCoder | 1344 | Nível: 3 | Tempo Limite: 2
Mean Median Problem
Adaptado por None
Competição: Maratona de Programação da SBC 2017 - Fase Nacional
The mean of three integers A, B and C is (A + B + C)/3. The median of three integers is the one that would be in the middle if they are sorted in non-decreasing order.
Write a program that, given two distinct integers A and B, determines the minimum possible integer C such that the mean and the median of A, B and C are equal.
Entrada
The input consists of a single line that contains two integers A and B (1 ≤ A ≤ B ≤ 109).
Saída
Output a single line with the minimum possible integer C such that the mean and the median of A, B and C are equal.
Exemplo de Entrada | Exemplo de Saída |
---|---|
1 1000000000 |
-999999998
|
6 10 |
2
|
1 2 |
0
|