USACO 2016 December Contest, Bronze Problem 1. Square Pasture

When I run this code in, 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:

Your program wrote this on standard output:

This is the code I ran in, and received the correct output:

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.

I didnt put any newlines or spaces in the output of my code…

You need to use file I/O for older problems. The link I included above describes how to do this.