public class PointTest {
public static int getArea(Point p1,Point p2){
if(p1.getX()<0 || p1.getY()<0 || p2.getX()<0 || p2.getY()<0)
return -1;
return Math.abs(p1.getX() - p2.getX())*Math.abs(p1.getY() - p2.getY());
}
public static void main(String[] args) {
System.out.println(PointTest.getArea(new Point(2,10), new Point(4, 55)));
}
}
class Point{
private int x;
private int y;
public Point(int x,int y){
this.x = x;
this.y = y;
}
public int getX(){
return x;
}
public int getY(){
return y;
}
}