using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace YukiCoder2 { class Program { static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); var sum = 0; for (int i = 0; i < n; i++) { var line = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); int element = (line[0] + 1)/2; sum += element*line[1]; sum %= 1000000000 + 7; } Console.WriteLine(sum); } } }