시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 828 460 433 58.514%

문제

강민이 동생 희주는 올해 초등학교에 입학했다. 며칠 있으면, 생애 첫 시험을 보게 될텐데, 수학시험도 같이 본다고 한다.

희주는 겁을 먹은 나머지, 열심히 준비해야겠다고 생각했다. 이를 본 오빠 강민이는 동생 희주를 위해 작은 도움을 주고자 한다.

연습문제 중에 하나가 정수를 적어나가는 것이였는데 수열은 1이 한 개, 2가 두 개, 3이 세 개.. 와 같이 만들어진다.

이제 강민이는 희주에게 두 개의 정수 A, B를 부를텐데, 그럼 희주는 주어진 수열에서 A번째와 B번째 사이에 있는 모든 수들의 합을 말해야한다.

예를 들면, A가 1이고 B는 3이라면 답은 처음 세 개의 정수를 더한 1+2+2 = 5 가 된다.

희주에게 문제를 내기 위해 정답을 계산하는 프로그램을 작성하시오.

입력

한 줄에 양의 정수 A와 B가 주어진다. (1 ≤ A ≤ B ≤ 1000)

출력

희주가 대답해야 할 정답을 출력한다.

예제 입력 1

1 3

예제 출력 1

5
W3sicHJvYmxlbV9pZCI6Ijg5NzQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQ3NmNcdWM4ZmNcdWM3NTggXHVjMjE4XHVkNTU5XHVjMmRjXHVkNWQ4IiwiZGVzY3JpcHRpb24iOiI8cD5cdWFjMTVcdWJiZmNcdWM3NzQmbmJzcDtcdWIzZDlcdWMwZGQgXHVkNzZjXHVjOGZjXHViMjk0IFx1YzYyY1x1ZDU3NCBcdWNkMDhcdWI0ZjFcdWQ1NTlcdWFkNTBcdWM1ZDAgXHVjNzg1XHVkNTU5XHVkNTg4XHViMmU0LiZuYnNwO1x1YmE3MFx1Y2U2MCBcdWM3ODhcdWM3M2NcdWJhNzQsIFx1YzBkZFx1YzU2MCZuYnNwO1x1Y2NhYiBcdWMyZGNcdWQ1ZDhcdWM3NDQgXHViY2Y0XHVhYzhjIFx1YjQyMFx1ZDE1MFx1YjM3MCwgXHVjMjE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GxzIE1hcmljYSB0d28gaW50ZWdlcnMgQSBhbmQgQjsgaGVyIHRhc2sgaXMgdG8gZmluZCB0aGUgc3VtIG9mIGludGVnZXJzIHdpdGggaW5kaWNlcyBiZXR3ZWVuIEEgYW5kIEIsIGluY2x1c2l2ZS4gRm9yIGV4YW1wbGUsIGlmIEEgaXMgMSBhbmQgQiBpcyAzLCB0aGVuIHRoZSBhbnN3ZXIgaXMgdGhlIHN1bSBvZiB0aGUgZmlyc3QgdGhyZWUgZWxlbWVudHMsIHdoaWNoIGlzIDErMisyPTUuJm5ic3A7PFwvcD5cclxuXHJcbjxwPldyaXRlIGEgcHJvZ3JhbSB0aGF0IGZpbmRzIHRoZSBzdW0gc28gdGhhdCBNYXJpY2EmIzM5O3MgYnJvdGhlciBjYW4gdmVyaWZ5IGhlciByZXN1bHQuJm5ic3A7PFwvcD5cclxuIiwiaW5wdXQiOiI8cD5UaGUgZmlyc3QgYW5kIG9ubHkgbGluZSBjb250YWlucyB0aGUgcG9zaXRpdmUgaW50ZWdlcnMgQSBhbmQgQiwgMSAmbGU7IEEgJmxlOyBCICZsZTsgMTAwMC4mbmJzcDs8XC9wPlxyXG5cclxuPHA+Jm5ic3A7PFwvcD5cclxuIiwib3V0cHV0IjoiPHA+T3V0cHV0IHRoZSBzdW0gb24gYSBzaW5nbGUgbGluZS4mbmJzcDs8XC9wPlxyXG5cclxuPHA+Jm5ic3A7PFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

Olympiad > Croatian Highschool Competitions in Informatics > 2008 > Regional Competition - Juniors 1번

  • 문제를 번역한 사람: joonas
  • 잘못된 조건을 찾은 사람: tncks0121