Preparing NOJ

Many Littles Make a Mickle

1000ms 262144K


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?


The 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.


Each 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.

Sample Input:

2 2
3 3

Sample Output:



CodeForces Gym

Provider CodeForces Gym

Origin 2021 Jiangxi Provincial Collegiate Programming Contest

Code GYM103366K


Submitted 0

Passed 0

AC Rate 0%

Date 10/25/2021 22:32:09


Nothing Yet