// Arup Guha
// Print out all the positive integer solutions to
// x + y + z = 100 with x < y < z.

#include <stdio.h>

#define N 1000

int main() {

    int x, y, z;

    int count = 0;
    int numtimes = 0;
    for (x=1; x<=N; x++) {
        for (y=x+1; y<=N; y++) {
            for (z=y+1; z<=N; z++) {
                numtimes++;
                if (x+y+z == N) {
                    count++;
                    //printf("%d + %d + %d = 100\n", x,y,z);
                }
            }
        }
    }
    printf("Loop ran %d times.\n", numtimes);

    printf("Number of solutions = %d\n", count);

    return 0;
}
