def main(): r,c = map(int, raw_input().split(' ')) if r % 2 != 0:
base = 5*(r-1)
else:
base = 5*(r-2) + 1 col = (c-1) * 2 print base + col main()
Link:
https://www.hackerrank.com/challenges/strange-grid/submissions/code/11668215
学习:
本质就是找各个纬度的逻辑关系