fork download
  1. #include <stdio.h>
  2.  
  3. #define finput(a, b, c) do { fscanf(fstdin, "%lld %lld %lld", &a, &b, &c); } while(0)
  4. #define fast(s, c) do { setvbuf(s, c, _IOFBF, 1 << 20); } while(0)
  5.  
  6. char cinput[1 << 20];
  7. char coutput[1 << 20];
  8.  
  9. FILE* fstdin = NULL;
  10. FILE* fstdout = NULL;
  11.  
  12. long long a,b,c,m,d;
  13.  
  14. long long gcd(long long a, long long b) {
  15. return b == 0 ? a : gcd(b, a % b);
  16. }
  17.  
  18. long long lcm(long long a, long long b) {
  19. return (a / gcd(a, b)) * b;
  20. }
  21.  
  22. int main(int argc, char* argv[], char* envp[]) {
  23. fstdin = fopen("SMARTKEY.INP", "r");
  24. if (fstdin == NULL) return 0;
  25.  
  26. fstdout = fopen("SMARTKEY.OUT", "w");
  27. if (fstdout == NULL) {
  28. fclose(fstdin);
  29. return 0;
  30. }
  31.  
  32. fast(fstdin, cinput);
  33. fast(fstdout, coutput);
  34.  
  35. finput(a, b, c); m = a+b+c;
  36. finput(a, b, c); d = a+b+c;
  37.  
  38. fprintf(fstdout, "%lld", lcm(m, d));
  39.  
  40. fclose(fstdin);
  41. fflush(fstdout);
  42. fclose(fstdout);
  43. return 0;
  44. }
  45.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty