2つの整数の組がn個与えられるので、各組の計算結果を足し合わせたものを出力してください。
各組の計算結果は次の値です。
・2つの整数の組を足し合わせたもの
・ただし、2つの整数が同じ値だった場合は、掛け合わせたもの
time = int(input())
result = 0
for i in range(time):
std_in = input()
array = std_in.split()
if array[0] == array[1]:
result += int(array[0]) * int(array[1])
else:
result += int(array[0]) + int(array[1])
print(result)
入力例1
5
2 1
3 6
4 2
4 4
4 70
出力例1
108