#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 = 1, lazy = -1;
};
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+CiNkZWZpbmUgTiAxMDAwMDA1CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbjsKc3RydWN0IGFuc3sKICAgIC8vdmFsOiBWYWx1ZSBhdCB0aGUgbm9kZSBpbiB0aGUgb3JpZ2luYWwgc3QKICAgIC8vbGF6eTogVmFsdWUgYXQgdGhlIG5vZGUgaW4gdGhlIGxhenkgc3QKICAgIGludCB2YWwgPSAxLCBsYXp5ID0gLTE7Cn07CgphbnMgc3RbTjw8Ml07CmludCBhW05dOwoKYW5zIG9wKGFucyB1LCBhbnMgdikgewogICAgYW5zIHc7CiAgICB3LnZhbCA9IHUudmFsICsgdi52YWw7CiAgICByZXR1cm4gdzsKfQoKdm9pZCBwcm9wYWdhdGUoaW50IGksaW50IGwsaW50IHIpCnsKICAgIHN0W2ldLnZhbCArPSBzdFtpXS5sYXp5ICogKHItbCsxKTsKICAgIGludCBsYyA9IChpPDwxKSAsIHJjID0gKGk8PDEpfDE7CiAgICBpZihsICE9IHIpewogICAgICAgIHN0W2xjXS5sYXp5ICs9IHN0W2ldLmxhenksXAogICAgICAgIHN0W3JjXS5sYXp5ICs9IHN0W2ldLmxhenk7CiAgICB9CiAgICBzdFtpXS5sYXp5ID0gMDsKfQoKdm9pZCBidWlsZChpbnQgaSwgaW50IGwsIGludCByKQp7CiAgICBpZihsID09IHIpewogICAgICAgIHN0W2ldLnZhbCA9IGFbbF07CiAgICB9CiAgICBlbHNlewogICAgICAgIGludCBsYyA9IChpPDwxKSAsIHJjID0gKGk8PDEpfDEgLCBtID0gKGwrcik+PjE7CiAgICAgICAgYnVpbGQobGMsIGwsIG0pOwogICAgICAgIGJ1aWxkKHJjLCBtKzEsIHIpOwogICAgICAgIHN0W2ldID0gb3Aoc3RbbGNdLCBzdFtyY10pOwogICAgfQp9Cgp2b2lkIHVwZGF0ZShpbnQgcWwsIGludCBxciwgaW50IHgsIGludCBpLCBpbnQgbCxpbnQgcikKewogICAgcHJvcGFnYXRlKGksIGwsIHIpOwoKICAgIGludCBtID0gKGwgKyByKSA+PiAxOwogICAgaW50IGxjID0gaSA8PCAxLCByYyA9IChpIDw8IDEpIHwgMTsKICAgIAogICAgaWYocWwgPD0gbCAmJiBxciA+PSByKXsKICAgICAgICBzdFtpXS5sYXp5ID0geDsKICAgICAgICBwcm9wYWdhdGUoaSwgbCwgcik7CiAgICAgICAgcmV0dXJuOwogICAgfQogICAgCiAgICBpZihxciA8IGwgfHwgcWwgPiByKQogICAgICAgIHJldHVybjsKICAgIGVsc2V7CiAgICAgICAgdXBkYXRlKHFsLCBxciwgeCwgbGMsIGwsIG0pOwogICAgICAgIHVwZGF0ZShxbCwgcXIsIHgsIHJjLCBtKzEsIHIpOwogICAgICAgIHN0W2ldID0gb3Aoc3RbbGNdLCBzdFtyY10pOwogICAgfQp9CgphbnMgcXVlcnkoaW50IHFsLGludCBxciwgaW50IGksIGludCBsLCBpbnQgcikKewogICAgcHJvcGFnYXRlKGksIGwsIHIpOwogICAgCiAgICBpZihxbCA8PSBsICYmIHFyID49IHIpCiAgICAgICAgcmV0dXJuIHN0W2ldOwoKICAgIC8vIGlmKHFyIDwgbCB8fCBxbCA+IHIpCiAgICAvLyAgcmV0dXJuIGFucygpOwoKICAgIGludCBtID0gKGwgKyByKSA+PiAxOwogICAgaW50IGxjID0gaSA8PCAxLCByYyA9IChpIDw8IDEpIHwgMTsKCiAgICBpZihxciA8PSBtKQogICAgICAgIHJldHVybiBxdWVyeShxbCwgcXIsIGxjLCBsLCBtKTsKICAgIGlmKHFsID4gbSkKICAgICAgICByZXR1cm4gcXVlcnkocWwsIHFyLCByYywgbSsxLCByKTsKICAgIAogICAgcmV0dXJuIG9wKHF1ZXJ5KHFsLHFyLGxjLGwsbSksIHF1ZXJ5KHFsLHFyLHJjLG0rMSxyKSk7Cn0KCi8qdm9pZCBwcmludF90cmVlKCkKewogICAgZm9yKGludCBpPTA7aTxuO2krKykKICAgICAgICBjZXJyIDw8IHF1ZXJ5KGksIGksIDEsIDAsIG4tMSkudmFsIDw8J1xuJzsKfSovCgptYWluKCkKewogICAgY291dCA8PCBzdFswXS52YWwgPDwgJyAnIDw8IHN0WzBdLmxhenkgPDwgJ1xuJzsKfQo=