Олимпиадный тренинг

Задача 34775. Governing Council


Задача

Темы: Цикл while
The governing council of the school includes parents, teachers and students of the school, and parents must be at least one third of the total number of members of the council. At the moment, the council includes N people, including K parents. Determine how many parents need to be added to the council so that their number becomes at least a third of the number of council members.
The program receives as input two integers N and K (N > 0, 0 ≤ K ≤ N), written in separate lines, — the current number of council members and the number of parents on the council.
The program should output a single number — the minimum number of parents to be included in the council.
 
Input Output Note
27
7
3 In the example, the council consists of 27 people, of which 7 people are parents. If 3 more parents are added to the council, then the council will have 30 people, of which there will be 10 parents.