Since input numbers are integers, pseudovector product absolute value will be at least 1 if they aren't parallel, so you can compare it to 0.5 to have bigger margin for double precision error.

1. Use integer calculation for judging if the answer is -1 or 0. 2. Use integer calculation until the last step for the area (an integer-division). 3. Use 'long long' instead of 'long' or 'int'.

This test shouldn't be applied: 0 0 3 0 1 0 1 0 0 because it is said that window lengths are positive. And that's true, I've checked. Or maybe a misprint?