Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = int(input())
- y = int(input())
- c = 0
- z = []
- f = False
- if x == y and x > 0:
- print(0)
- else:
- if x > 0:
- if y > 0:
- if (y + x) % 2 == 0:
- if x > y:
- n1 = "H"
- else:
- n1 = "V"
- z.append(((x + y) // 2, (x + y) // 2, n1))
- else:
- print(-1)
- else:
- if x > abs(y):
- n1 = "H"
- z1 = (x + y) // 2
- z2 = (x + y) // 2
- else:
- n1 = "H"
- z1 = (x + abs(y)) // 2
- z2 = (x + abs(y)) // 2
- f = True
- z.append((z1, z2, n1))
- if f:
- z.append((x + abs(y), 0, "V"))
- else:
- if y > 0:
- if abs(x) > y:
- n1 = "V"
- z1 = (abs(x) + y) // 2
- z2 = (abs(x) + y) // 2
- f = True
- else:
- n1 = "V"
- z1 = (x + y) // 2
- z2 = (x + y) // 2
- z.append((z1, z2, n1))
- if f:
- z.append((0, abs(x) + y, "H"))
- else:
- n1 = "H"
- z1 = (abs(x) + abs(y)) // 2
- z2 = (abs(x) + abs(y)) // 2
- f = True
- z.append((z1, z2, n1))
- if f:
- z.append((abs(x) + abs(y), 0, "V"))
- z.append((0, x + y, "H"))
- if z:
- print(len(z))
- for i in z:
- print(i[0], i[1], i[2])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement