#C2218. Sum of Adjacent Pair Elements

    ID: 45510 Type: Default 1000ms 256MiB

Sum of Adjacent Pair Elements

Sum of Adjacent Pair Elements

Given a list of integers, your task is to compute and output a list of tuples. Each tuple consists of two adjacent elements from the list and their sum. More formally, for a list \( lst = [a_1, a_2, \ldots, a_n] \) with \( n \geq 2 \), output the list \( [(a_1, a_2, a_1+a_2), (a_2, a_3, a_2+a_3), \ldots, (a_{n-1}, a_n, a_{n-1}+a_n)] \).

The output must be formatted as a Python list containing tuples, where each tuple is represented in the form (a, b, sum).

inputFormat

The input consists of a single line containing space-separated integers. There will be at least 2 integers.

outputFormat

Print the list of tuples in the exact Python list format. Each tuple should be formatted as (a, b, sum), where sum = a+b.

## sample
1 2 3 4 5
[(1, 2, 3), (2, 3, 5), (3, 4, 7), (4, 5, 9)]