using System; using System.Numerics; public class Hello { private const int MOD = 1000000007; public static void Main() { BigInteger ans = 0; var n = int.Parse(Console.ReadLine().Trim()); for (int i = 0; i < n; i++) { string[] line = Console.ReadLine().Trim().Split(' '); BigInteger c = BigInteger.Parse(line[0]); BigInteger d = BigInteger.Parse(line[1]); ans += ((c + 1) / 2L) * d; } ans %= MOD; Console.WriteLine(ans); } }