|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||3||3||3||100.000%|
The Jewish holiday of Chanukah lasts for eight days and eight nights. On the evening before each day, candles are lit in a menorah. On the first evening, one candle is lit, on the second, two are lit, and so on. However, each evening, an extra candle, called the shammas, is also lit (in fact, this candle is used to light the other candles). Thus, for the entire holiday, 44 candles are necessary.
But what if Chanukah lasted a different number of days? How many candles would be needed?
For this problem, you will write a program that determines how many candles would be necessary for a Chanukah holiday lasting for a given number of days.
The first line of input contains a single decimal integer P, (1 ≤ P ≤ 10000), which is the number of data sets that follow. Each data set should be processed identically and independently.
Each data set consists of a single line of input. It contains the data set number, K, followed by a single space, followed by a single decimal integer N, (1 ≤ N ≤ 10000), which gives the number of days to assume for the holiday.
For each data set there is one line of output. The single output line consists of the data set number, K, followed by a space followed by the number of candles needed for an N-day Chanukah holiday.
3 1 8 2 1 3 10
1 44 2 2 3 65