#include <stdio.h>
int main(void) {
int divisores_1700[300];
int divisores_encontrados_1700 = 0;
int divisores_57[57];
int divisores_encontrados_57 = 0;
int ax_candidato;
int bx_candidato;
int i, j;
for (bx_candidato = 1; bx_candidato <= 57; bx_candidato++) {
if (57 % bx_candidato == 0) {
divisores_57[divisores_encontrados_57] = bx_candidato;
divisores_encontrados_57++;
}
}
for (ax_candidato = 1; ax_candidato <= 300; ax_candidato++) {
if (1700 % ax_candidato == 0 && 1700/ax_candidato <= 300) {
divisores_1700[divisores_encontrados_1700] = ax_candidato;
divisores_encontrados_1700++;
}
}
for (i = 0; i < divisores_encontrados_57; i++) {
for (j = 0; j < divisores_encontrados_1700; j++) {
int a_x, a_y, b_x, b_y;
a_x = divisores_1700[j];
a_y = 1700/a_x;
b_x = divisores_57[i];
b_y = 57/b_x;
printf("(%d/%d) * (%d/%d) == 1700/57\n", a_x
, b_x
, a_y
, b_y
); }
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgZGl2aXNvcmVzXzE3MDBbMzAwXTsKCWludCBkaXZpc29yZXNfZW5jb250cmFkb3NfMTcwMCA9IDA7CgkKCWludCBkaXZpc29yZXNfNTdbNTddOwoJaW50IGRpdmlzb3Jlc19lbmNvbnRyYWRvc181NyA9IDA7CglpbnQgYXhfY2FuZGlkYXRvOwoJaW50IGJ4X2NhbmRpZGF0bzsKCQoJaW50IGksIGo7CgkKCWZvciAoYnhfY2FuZGlkYXRvID0gMTsgYnhfY2FuZGlkYXRvIDw9IDU3OyBieF9jYW5kaWRhdG8rKykgewoJICAgIGlmICg1NyAlIGJ4X2NhbmRpZGF0byA9PSAwKSB7CgkgICAgICAgIGRpdmlzb3Jlc181N1tkaXZpc29yZXNfZW5jb250cmFkb3NfNTddID0gYnhfY2FuZGlkYXRvOwoJICAgICAgICBkaXZpc29yZXNfZW5jb250cmFkb3NfNTcrKzsKCSAgICB9Cgl9CgkKCWZvciAoYXhfY2FuZ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