When I run this code in repl.it, it works perfectly fine with the test case that was given, although when I submit the code, it gives me this error:
Incorrect answer on sample input case – details below
Your output file square.out:
[File missing!]
The correct answer:
49
Your program wrote this on standard output:
1901182976
This is the code I ran in repl.it, and received the correct output:
#include
using namespace std;
int main() {
** int x1, y1, x2, y2, a1, b1, a2, b2;**
** int area1, area2, finalarea;**
** cin >> x1 >> y1 >> x2 >> y2;**
** cin >> a1 >> b1 >> a2 >> b2;**
** area1 = (x2 - x1) * (y2 - y1);**
** area2 = (a2 - a1) * (b2 - b1);**
** finalarea = (area1 + area2) * (area1 + area2);**
** cout << finalarea;**
}
Any help would be greatly appreciated, as I will be taking the US Open contest soon, and I don’t want anything like this to occur.