Company: exxonmobil_5sep
Difficulty: medium
Sum of Remainders Problem Description You are given two integers n and div . Find and print the sum of remainders given by numbers from 1 to n (both inclusive) on being divided by div . Input format: The input consists of two lines: The first line contains an integer, i.e. n . The second line contains an integer, i.e. div . The input will be read from the STDIN by the candidate. Output format: Print the sum of remainders given by numbers from 1 to n (both inclusive) on being divided by div . The output will be matched to the candidate's output printed on the STDOUT. Examples Example 1: Input: 12 4 Output: 18 Explanation: The sum of remainders left by numbers from 1 to 12 on being divided by 4 is 1+2+3+0+1+2+3+0+1+2+3+0 = 18. Example 2: Input: 15 5 Output: 30 Constraints 0 < n < 10 5 0 < div < 10 5 Instructions: Program should take input from standard input and print output to standard output.