Descrição
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.
Exemplos de Entrada | Exemplos de Saída |
---|---|
1 1000000000 |
-999999998
|
6 10 |
2
|
1 2 |
0
|
Efetue Login ou Cadastre-se para submeter uma solução.
Competição: Maratona de Programação da SBC 2017 - Fase Nacional