GEO - Area and line

no tags 

Esraa, Morgan, Hussein and Yasser didn’t love geometry but Abdelkarim loved it so much. Abdelkarim (the coach) decided to challenge them, he gave them a linear function and he wanted them to calculate the area between the line, x-axis and y-axis.

They want you to help them solve this problem. You will be given a, b, c as ay = bx + c.

Find the area between this line, x-axis and y-axis

It is guaranteed that the area is an integer number.

it is guaranteed that the line is not parallel to x or y-axis.

Input

The first line of input begins with a line containing T the number of test cases.

Each test case starts with a line contains three separated integer numbers a, b, c  (-109 ≤ a, b, c ≤ 109.)

Output

For each test case print a line contains the area between the x-axes, y-axis and the line .

Example

Input:
2
2 4 8
2 4 0

Output:
4
0

hide comments
xk404: 2015-12-27 18:28:21

Guys!!!
Move it back please :) That problem had quite high score on ojstats(http://ojstats.cs.put.poznan.pl/) which i need for studies and now it's lost. That's not fair...

dwij28: 2015-12-26 00:24:08

I see a bunch of angry people here in the comments .. LOL .. Tutorial Stuff, but I solve questions like these in languages that I am not very comfortable with because I don't use them a lot, helps me stay familiar with the syntax and common stuff. Its completely upto you how you can turn a seemingly useless stuff into something useful . :)

Last edit: 2015-12-26 00:24:30
iharsh234: 2015-12-25 04:21:56

move to tutorials.

xk404: 2015-12-24 21:05:05

Yes it does. It teaches that int size is to small for some problems :)

anuj0503: 2015-12-24 17:00:44

Very bad! this question has nothing to teach

Umesh Malhotra: 2015-12-22 19:43:32

Very bad! this question has nothing to teach

maverick_10: 2015-12-22 19:26:55

Very bad! this question has nothing to teach

Prakhar Dev Gupta: 2015-12-21 16:06:15

Very bad! this question has nothing to teach

anil2496: 2015-12-19 15:09:20

worst question


Added by:MorGaN
Date:2015-12-18
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 GOSU JS-MONKEY