aboutsummaryrefslogtreecommitdiff
path: root/c/las12uvas/2020/583_encuestaComprometedora.cpp
blob: 6a46d4e841aa66d8896d4933ff5989c2fa5a9f36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>

int main() {

	int casos, comp, segunda;
	int n;
	int nReal;
	int compReal;
	int porcentaje;

	std::cin >> casos;

	while (casos > 0) {
		std::cin >> comp;
		std::cin >> segunda;

		n = comp + segunda;
		nReal = n/2;
		compReal = comp - nReal;
		porcentaje = compReal * 100 / nReal;

		std::cout << porcentaje << '\n';

		casos--;
	}

	return 0;
}