A = 5.
b = 5 + 2 = 7.
a = (5 + 2) * (7 - 3) = 7 * 4 = 28.
b = 28 div 5 = 5.
a = 28 mod 5 = 3.
a = 3 + 1 = 4.
b = (4 + 14) mod 7 = 18 mod 7 = 4.
Ответ: 4.
Сумма чаевых официанту: Sum = 0.15 * (X1 + X2 + X3);
Если X1 = X2 = X3, то Sum = 0.15 * 3 * X = 0.45 * X
#include <iostream>
int main() {
int n;
std::cin >> n;
double a[n], sum = 0;
for(int i = 0; i < n; i++) std::cin >> a[i];
for(int i = 0; i < n/2; i++, sum+=a[i]);
std::cout << sum << std::endl;
}