링크 : https://www.acmicpc.net/problem/1292
#include <iostream>
#include <vector>
using namespace std;
int main(){
int A, B;
cin >> A >> B;
vector<int> v;
int cnt = 1;
for(int i = 1; i <= B; i++){
for(int j = 0; j < i; j++){
if(cnt > B) break;
cnt ++;
v.push_back(i);
}
}
int sum = 0;
for(int i = A; i <= B; i++){
sum += v[i-1];
}
cout << sum;
return 0;
}