#include <stdio.h>
#include <stdlib.h>

#define PROJECT_NAME "findgcf"
#define VERSION "0a"

int main(int argc, char ** argv) {

	printf("%s %s\n", PROJECT_NAME, VERSION);
	
	if (argc == 4 || argc == 3) {

		float b = atof(argv[1]);
		float c = atof(argv[2]);
		float a = atof(argv[3]);

		if (a==0) {
			a=1;
		}

		int gcf0=-255; int gcf1=-255;

		while (1) {
			if (gcf0 * gcf1 == a*c && gcf0 + gcf1 == b) {
				printf("%d,%d\n",gcf0,gcf1);
				break;
			} else {
				if (gcf0 < 21) {
					gcf0++;
				} else {
					gcf1++;
					gcf0=0;
				}
			}
		}
		return 0;

	} else {

		fprintf(stderr, "%s: invalid number of arguments (%d)\n", argv[0], argc);
		return 3;

	}

	return 0;
}
