Skip to content

Commit

Permalink
Python Version Of Solution Added
Browse files Browse the repository at this point in the history
  • Loading branch information
armurox committed Oct 27, 2023
1 parent 9d0b006 commit b71639b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crossmarket/cross.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def main():
t = int(input())
for _ in range(t):
n, m = map(int, input().split())
if n == m == 1:
print(0)
elif m < n:
print(2*m + n - 2)
else:
print(2*n + m - 2)

if __name__ == "__main__":
main()

0 comments on commit b71639b

Please sign in to comment.