fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5. unsigned long p, q;
  6. char c;
  7.  
  8. while ((c = getchar_unlocked()) != EOF) {
  9. p = c - '0';
  10.  
  11. while ((c = getchar_unlocked()) != ' ') {
  12. p = (p<<1) + (p<<3) + c - '0';
  13. }
  14.  
  15. q = 0;
  16. while ((c = getchar_unlocked()) != '\n') {
  17. q = (q<<1) + (q<<3) + c - '0';
  18. }
  19. q += p;
  20. q *= q;
  21. // q = 100*q/p;
  22. printf("%ld,%02ld\n", q/p, q%100);
  23. }
  24.  
  25. return 0;
  26. }
  27. /*
  28. 171.50
  29. 125.00
  30. 12100077.00
  31. 14779724538.07
  32. 400.00
  33. 1000000000000000000.00
  34. */
Success #stdin #stdout 0.01s 5420KB
stdin
14 35
20 30
99999 999999
5432 8954672
100 100
1 999999999
stdout
171,01
125,00
12100077,04
14779724538,16
400,00
1000000000000000000,00