package net.ipipip0129.yukicoder.no146; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int cnt = scan.nextInt(); long capacity = 0; for (int i = 0; i < cnt; i++) { int chair = scan.nextInt(); int desk = scan.nextInt(); capacity += Math.ceil((double) chair / 2) * desk; } System.out.println((int) (capacity % (Math.pow(10, 9) + 7))); } }