#include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)<> N; rep(i,N){ cin>>C[i]>>D[i]; } ////////////// LL mod = (int)1e9 + 7; LL sum = 0; rep(i,N){ sum += (((C[i]+1)/2)%mod) * (D[i]%mod); sum %= mod; } P(sum); return 0; }