fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int alvqntoffood, messcnt, packets_per_mess, remaining_packets;
  5.  
  6. // Input the number of food packets and the number of messes
  7. scanf("%d %d", &alvqntoffood, &messcnt);
  8.  
  9. // Calculate the number of packets per mess
  10. packets_per_mess = alvqntoffood / messcnt;
  11.  
  12. // Calculate the remaining packets after equal distribution
  13. remaining_packets = alvqntoffood % messcnt;
  14.  
  15. // Output the results
  16. printf("%d %d\n", packets_per_mess, remaining_packets);
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0.03s 25848KB
stdin
1
2
10
42
11
stdout
#include <stdio.h>

int main() {
    int alvqntoffood, messcnt, packets_per_mess, remaining_packets;

    // Input the number of food packets and the number of messes
    scanf("%d %d", &alvqntoffood, &messcnt);

    // Calculate the number of packets per mess
    packets_per_mess = alvqntoffood / messcnt;

    // Calculate the remaining packets after equal distribution
    remaining_packets = alvqntoffood % messcnt;

    // Output the results
    printf("%d %d\n", packets_per_mess, remaining_packets);

    return 0;
}