A. Ice Cream
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
1
1 1 3
Output
6
Input
2
4 7 22
4 8 22
Output
24
24