#include #include #include #include struct hoge { long ans; int a; int b; std::map imp; void calc(int q) { static std::map> table = { {0, [this](){imp[a]+=b;}}, {1, [this](){for (int i=a;i<=b;i++) ans+=imp[i];}}, }; table[q](); }; }; int main() { int q; int c; struct hoge Hoge; Hoge.ans = 0; scanf("%d",&c); for (int i=0;i