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