fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int n;
  5. scanf("%d", &n);
  6. for (int i = 0; i < n; i++)
  7. {
  8. int p;
  9. scanf("%d", &p);
  10. int p1 = p - (p / 500 * 180);
  11. if ((p - p1) > 600) p1 = p - 600;
  12. int p2 = p * 65 / 100;
  13. if ((p - p2) > 600) p2 = p - 600;
  14. printf("%d %d\n", p1, p2);
  15. }
  16. }
Success #stdin #stdout 0s 3472KB
stdin
3
1000
1200
2000
stdout
640 650
840 780
1400 1400