Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
421 B
2
Indexable
Never
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    int n, m;
    cin >> m >> n;
    int smrk = 0;
    int ret = 0;
    for(int i = 1; i <= n; i++) {
        smrk++;
        if(smrk == 4) {
            smrk = 1;
        }
        if(i > m) {
            ret += smrk;
        }
    }
    cout << ret << endl;
    return 0;
}