fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Codeforces
  8. {
  9. class Class27
  10. {
  11. public static void Main()
  12. {
  13. string[] s = Console.ReadLine().Split(' ');
  14. int a1 = int.Parse(s[0]);
  15. int a2 = int.Parse(s[1]);
  16. int cnt1 = 0;
  17. int cnt2 = 0;
  18. cnt1 = Math.Min(a1, a2);
  19. int max = Math.Max(a1, a2);
  20. if (((max - cnt1) % 2) == 0)
  21. cnt2 = (max - cnt1) / 2;
  22. else
  23. {
  24. if ((max - 1 - cnt1) == 0)
  25. cnt2 = 0;
  26. else
  27. cnt2 = (max - 1 - cnt1) / 2;
  28. }
  29. Console.WriteLine(cnt1 + " " + cnt2);
  30. }
  31. }
  32. }
  33.  
Success #stdin #stdout 0.02s 16252KB
stdin
3 1
stdout
1 1