By Kay Akashi
Mean arterial blood pressure (MABP) can provide you with the notional average of blood pressure of an individual during each cardiac cycle. In order to calculate this value, you're usually given diastolic pressure (lowest aortic pressure when the heart is at rest) and systolic pressure (highest aortic pressure when the heart is contracting). Then, you calculate what is referred to as pulse pressure which you can calculate by subtracting diastolic pressure from systolic pressure. With those values, MABP can be calculated in a following way:
MABP = (diastolic pressure) + × (pulse pressure)
Today, Kay and his friend Haniyah are coming to the clinical placement supervised by the GP practitioner. The doctor was asking Kay to record one patient's diastolic pressure, systolic pressure, and MABP. However, Haniyah noticed that Kay wasn't writing down the patient's systolic pressure, while diastolic pressure and calculated MABP were accurately recorded. Being so kind, she added the patient's systolic pressure by calculating based on the provided values of systolic pressure and MABP to the record before submission so that Kay won't be scolded by the doctor. What was the value Haniyah added to the record?
Unit of MABP, systolic pressure, and diastolic pressure is .
MABP, systolic pressure . It is ensured that the resulting systolic pressure is higher than or equal to diastolic pressure, and is between and . All the input values are integers.
The input consists of integers, and , indicating MABP and diastolic pressure.
Output the systolic pressure in a single line. Round an answer to the nearest integer.
107 98
125
When the systolic pressure is and diastolic pressure is , the pulse pressure is . Thus, the MABP is that agrees with the MABP given in input.
138 138
138
In healthy individuals systolic and diastolic pressures wouldn't be equal, but note that this kind of testcases might be present.