List

No attempts yetTime limit1sMemory limit512 MB

Problem

You are given a list LL containing all natural numbers from 11 to nn in order. If you move the last kk numbers of this list to the front, you obtain a new list L1L_1. For example, moving the last three numbers of the list 1,2,3,4,5,6,71, 2, 3, 4, 5, 6, 7 to the front gives 5,6,7,1,2,3,45, 6, 7, 1, 2, 3, 4.

Given two integers ii and jj in the range [1,n][1, n], you want to find the sum of the elements of L1L_1 from the ii-th to the jj-th position, inclusive. For the list above with i=2i = 2 and j=6j = 6, that sum is 6+7+1+2+3=196 + 7 + 1 + 2 + 3 = 19.

Write a program that reads nn, kk, ii, and jj from standard input, computes the sum of the elements of L1L_1 from the ii-th to the jj-th position, and prints the result to standard output.

Input

The first and only line contains four integers nn, kk, ii, and jj separated by single spaces (2n1092 \le n \le 10^9, 1kn1 \le k \le n, 1ijn1 \le i \le j \le n).

Output

Print a single integer equal to the sum of the elements of L1L_1 from the ii-th to the jj-th position, inclusive.