#include<bits/stdc++.h>
#define vi vector<int>
#define va vector<ans>
#define N 1000005
using namespace std;
int n;
struct ans{
//val: Value at the node in the original st
//lazy: Value at the node in the lazy st
int val, lazy;
ans(int _val=1, int _lazy=-1)
:val(_val), lazy(_lazy){}
};
ans st[N<<2];
int a[N];
ans op(ans u, ans v) {
ans w;
w.val = u.val + v.val;
return w;
}
void propagate(int i,int l,int r)
{
st[i].val += st[i].lazy * (r-l+1);
int lc = (i<<1) , rc = (i<<1)|1;
if(l != r){
st[lc].lazy += st[i].lazy,\
st[rc].lazy += st[i].lazy;
}
st[i].lazy = 0;
}
void build(int i, int l, int r)
{
if(l == r){
st[i].val = a[l];
}
else{
int lc = (i<<1) , rc = (i<<1)|1 , m = (l+r)>>1;
build(lc, l, m);
build(rc, m+1, r);
st[i] = op(st[lc], st[rc]);
}
}
void update(int ql, int qr, int x, int i, int l,int r)
{
propagate(i, l, r);
int m = (l + r) >> 1;
int lc = i << 1, rc = (i << 1) | 1;
if(ql <= l && qr >= r){
st[i].lazy = x;
propagate(i, l, r);
return;
}
if(qr < l || ql > r)
return;
else{
update(ql, qr, x, lc, l, m);
update(ql, qr, x, rc, m+1, r);
st[i] = op(st[lc], st[rc]);
}
}
ans query(int ql,int qr, int i, int l, int r)
{
propagate(i, l, r);
if(ql <= l && qr >= r)
return st[i];
// if(qr < l || ql > r)
// return ans();
int m = (l + r) >> 1;
int lc = i << 1, rc = (i << 1) | 1;
if(qr <= m)
return query(ql, qr, lc, l, m);
if(ql > m)
return query(ql, qr, rc, m+1, r);
return op(query(ql,qr,lc,l,m), query(ql,qr,rc,m+1,r));
}
/*void print_tree()
{
for(int i=0;i<n;i++)
cerr << query(i, i, 1, 0, n-1).val <<'\n';
}*/
main()
{
cout << st[0].val << ' ' << st[0].lazy << '\n';
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSB2aSB2ZWN0b3I8aW50PgojZGVmaW5lIHZhIHZlY3RvcjxhbnM+CiNkZWZpbmUg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W50IHFyLCBpbnQgeCwgaW50IGksIGludCBsLGludCByKQp7CiAgICBwcm9wYWdhdGUoaSwgbCwgcik7CgogICAgaW50IG0gPSAobCArIHIpID4+IDE7CiAgICBpbnQgbGMgPSBpIDw8IDEsIHJjID0gKGkgPDwgMSkgfCAxOwogICAgCiAgICBpZihxbCA8PSBsICYmIHFyID49IHIpewogICAgICAgIHN0W2ldLmxhenkgPSB4OwogICAgICAgIHByb3BhZ2F0ZShpLCBsLCByKTsKICAgICAgICByZXR1cm47CiAgICB9CiAgICAKICAgIGlmKHFyIDwgbCB8fCBxbCA+IHIpCiAgICAgICAgcmV0dXJuOwogICAgZWxzZXsKICAgICAgICB1cGRhdGUocWwsIHFyLCB4LCBsYywgbCwgbSk7CiAgICAgICAgdXBkYXRlKHFsLCBxciwgeCwgcmMsIG0rMSwgcik7CiAgICAgICAgc3RbaV0gPSBvcChzdFtsY10sIHN0W3JjXSk7CiAgICB9Cn0KCmFucyBxdWVyeShpbnQgcWwsaW50IHFyLCBpbnQgaSwgaW50IGwsIGludCByKQp7CiAgICBwcm9wYWdhdGUoaSwgbCwgcik7CiAgICAKICAgIGlmKHFsIDw9IGwgJiYgcXIgPj0gcikKICAgICAgICByZXR1cm4gc3RbaV07CgogICAgLy8gaWYocXIgPCBsIHx8IHFsID4gcikKICAgIC8vICByZXR1cm4gYW5zKCk7CgogICAgaW50IG0gPSAobCArIHIpID4+IDE7CiAgICBpbnQgbGMgPSBpIDw8IDEsIHJjID0gKGkgPDwgMSkgfCAxOwoKICAgIGlmKHFyIDw9IG0pCiAgICAgICAgcmV0dXJuIHF1ZXJ5KHFsLCBxciwgbGMsIGwsIG0pOwogICAgaWYocWwgPiBtKQogICAgICAgIHJldHVybiBxdWVyeShxbCwgcXIsIHJjLCBtKzEsIHIpOwogICAgCiAgICByZXR1cm4gb3AocXVlcnkocWwscXIsbGMsbCxtKSwgcXVlcnkocWwscXIscmMsbSsxLHIpKTsKfQoKLyp2b2lkIHByaW50X3RyZWUo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