1006: 求等差数列的和
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);int a=cin.nextInt();int b=cin.nextInt();int c=cin.nextInt();int d=(b-a)/c+1;System.out.println((a+b)*d/2);}
}