fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4. #include <stdlib.h>
  5.  
  6. int main() {
  7. long long int r,c,num;
  8. scanf("%lld%lld",&r,&c);
  9. if(r%2 == 0)
  10. {
  11. num = 10*((r/2)-1)+1;
  12. num = num + 2*(c-1);
  13. }
  14. else
  15. {
  16. num = 10*(r/2);
  17. num = num + 2*(c-1);
  18. }
  19. printf("%lld\n",num);
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 2056KB
stdin
6 3
stdout
25