#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i,a) for(int i=(int)0;i<(int)a;++i) #define pb push_back #define eb emplace_back #define all(x) x.begin(),x.end() using ll=long long; constexpr ll mod = 1e9 + 7; constexpr ll INF = 1LL << 60; ll gcd(ll n, ll m) { ll tmp; while (m!=0) { tmp = n % m; n = m; m = tmp; } return n; } ll lcm(ll n, ll m) { return abs(n * m) / gcd(n, m);//gl=xy } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } using namespace std; //ここから void solve(){ int n; cin>>n; vectora(2*n); rep(i,2*n)cin>>a[i]; vectorsub(n); rep(i,n){ sub[i]=-a[2*i+1]+a[2*i]; } rep(i,n-1)sub[i+1]+=sub[i]; // rep(i,n)cout<rsub(n); //rep(i,n)rsub[n-1-i]=a[2*n-1-2*i]-a[2*n-2-2*i]; for(int i=n-1;i>0;--i)rsub[i-1]+=rsub[i]; //rep(i,n)cout<