Logo
(追記) (追記ここまで)

15295번 - Chanukah Challenge 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB60755949192.467%

문제

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.

제한

예제 입력 1

3
1 8
2 1
3 10

예제 출력 1

1 44
2 2
3 65

힌트

출처

ICPC > Regionals > North America > Greater New York Region > 2017 Greater New York Programming Contest A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /