#include <stdio.h>
int main(void) {
int total, nota1, nota2, notas1, notas2;
scanf("%i", &total
); //total a ser sacado scanf("%i %i", ¬a1
, ¬a2
); //ler os dois tipos de nota
//divisão de inteiro por inteiro resulta apenas a parte inteira da divisão
//eu garanti com o casting (int) que converte um valor para inteiro
notas1 = (int)total / nota1;
total = total - (notas1 * nota1); //desconta o que já foi dado em notas do primeiro tipo
notas2 = (int)total / nota2; //faz o mesmo para a outra nota
printf("Notas de %i: %i \n", nota1
, notas1
); printf("Notas de %i: %i", nota2
, notas2
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgdG90YWwsIG5vdGExLCBub3RhMiwgbm90YXMxLCBub3RhczI7CglzY2FuZigiJWkiLCAmdG90YWwpOyAvL3RvdGFsIGEgc2VyIHNhY2FkbwoJc2NhbmYoIiVpICVpIiwgJm5vdGExLCAmbm90YTIpOyAvL2xlciBvcyBkb2lzIHRpcG9zIGRlIG5vdGEKCQoJLy9kaXZpc8OjbyBkZSBpbnRlaXJvIHBvciBpbnRlaXJvIHJlc3VsdGEgYXBlbmFzIGEgcGFydGUgaW50ZWlyYSBkYSBkaXZpc8OjbwoJLy9ldSBnYXJhbnRpIGNvbSBvIGNhc3RpbmcgKGludCkgcXVlIGNvbnZlcnRlIHVtIHZhbG9yIHBhcmEgaW50ZWlybwoJbm90YXMxID0gKGludCl0b3RhbCAvIG5vdGExOyAKCXRvdGFsID0gdG90YWwgLSAobm90YXMxICogbm90YTEpOyAvL2Rlc2NvbnRhIG8gcXVlIGrDoSBmb2kgZGFkbyBlbSBub3RhcyBkbyBwcmltZWlybyB0aXBvCglub3RhczIgPSAoaW50KXRvdGFsIC8gbm90YTI7IC8vZmF6IG8gbWVzbW8gcGFyYSBhIG91dHJhIG5vdGEKCQoJcHJpbnRmKCJOb3RhcyBkZSAlaTogJWkgXG4iLCBub3RhMSwgbm90YXMxKTsKCXByaW50ZigiTm90YXMgZGUgJWk6ICVpIiwgbm90YTIsIG5vdGFzMik7CgkKCXJldHVybiAwOwp9Cg==