My solution is-
#include <iostream>
using namespace std;
int main() {
int A,X,Y;
cin >> A;
for (int i = 0; i < A; i++) {
cin >> X >> Y;
cout << (X/2) + (Y/2) + 1 << "\n";
}
}
But I am getting wrong answer. Is it formatting related.
My solution is-
#include <iostream>
using namespace std;
int main() {
int A,X,Y;
cin >> A;
for (int i = 0; i < A; i++) {
cin >> X >> Y;
cout << (X/2) + (Y/2) + 1 << "\n";
}
}
But I am getting wrong answer. Is it formatting related.
Be careful about the extreme values of X and Y. What about X and/or Y being equal to 0?!
Contest not ended, I don’t think that is a good idea to give big hints like this.