main() { int a,b,c; int ab(int,int); scanf("%d%d",&a,&b); c=ab(a,b); printf("%d",c); } int ab(int a,int b) { if(b>a) return (a+b)*(b-a+1)/2; else return (a+b)*(a-b+1)/2; }