#include #include #include #include #include #include #include #include #include #include #define rep(i,j,k) for(int i=j;i #define INF 1000000000 #define MOD 1000000009 #define pb push_back #define mp make_pair typedef long long ll; typedef unsigned long long ull; int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0}; using namespace std; ll gcd(ll a,ll b){ if(a>n; rep(i,0,n){ ll a,b; cin>>a>>b; if(a%2==1)ans+=(a/2+1)*b; else ans+=(a/2)*b; if(ans>MOD)ans%=MOD; } cout<