Series of Powers

In this problem the summation of series of powers is defined as below: S(l,h,k)=lk +(l+1)k +(l+2)k +...(h−1)k +hk Given the value of l, h and k your job is to find the value of S(l,h,k) Input The input file contains around 1500 lines of inputs. Each line contains three integers l, h (0 ≤ l ≤ h ≤ 15000000 and |l − h| ≤ 1000) and k (1 ≤ k ≤ 15000000). Input is terminated by a line containing three minus 1. Output For each line of input produce one line of output. This line contains the serial of output (printed in field width of four) followed by the approximate value of S(l,h,k). This approximate value should be of the form 0.ddddddedddddddddd. The value of mantissa is always less than 1 and has six digits after the decimal point. If value of the exponent is irrelevant (Does not effect the value of the number) set its value as 1. Follow the exact formatting shown in the sample output. Small precision errors (less than 10−4) are allowed for the value of Mantissa. Sample Input 1 10 10 10 15 100 -1 -1 -1 Sample Output Case 0001: 0.149143e0000000011 Case 0002: 0.406971e0000000118