#include #include #include using namespace atcoder; using mint = modint1000000007; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000 int main(){ int n; cin>>n; mint ans = 0; rep(_,n){ long long c,d; cin>>c>>d; c = (c+1)/2; mint an = c; an *= d; ans += an; //cout<