【代码】
package Huawei;
import java.util.Scanner;
/**
* @description:
* @author: Polaris
* @date: 2022/3/30 23:24
*/
public class no13 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()) {
int area=0,preX = 0,preY=0;
int n1 = sc.nextInt();
int maxX = sc.nextInt();
for(int i=0;i<n1;i++){
int nowX = sc.nextInt();
int nowY = sc.nextInt();
area += (nowX-preX)*preY;
preX = nowX;
preY+=nowY;
}
area += preY*(maxX-preX);
System.out.print(area);
}
}
}