408871: GYM103366 K Many Littles Make a Mickle
Description
Gather sand to form a tower is a Chinese idiom, whose Pinyin is $$$j\grave{u}\ sh\bar{a}\ ch\acute{e}ng\ t\check{a}$$$. It means to pile sand into a pagoda, referring that a little makes a lot. From the fahua Sutra - convenience products.
Suppose the tower has $$$N$$$ floors. There are $$$i\times i$$$ rooms on the $$$i^\text{th}$$$ floor. Each room can accommodate $$$M$$$ people. How many people can the $$$N$$$ floor tower accommodate?
InputThe first line is a positive integer $$$T\ (1 \le T \le 100)$$$, indicating that there are $$$T$$$ test data.
Next, there are $$$T$$$ lines. Each line has two positive integers $$$N$$$ and $$$M\ (1 \le N,M \le 100)$$$, indicating the number of floors of the tower and the number of people that can be accommodated in each room in a test data.
OutputEach test data outputs a line containing one positive integer, that is, the total number of people that can be accommodated in the $$$N$$$ floor tower.
ExampleInput2 2 2 3 3Output
10 42