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

14542번 - Outer Triangle Sum 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
10 초 512 MB57133630760.433%

문제

You are to find the sum of the outer number of an isosceles right triangle.

For example, for n = 5 the isosceles right triangle grid are filled with non-negative integers that are less than 100:

5 
1 8 
9 6 1 
2 7 2 6 
3 5 7 8 9

The sums of the outer integers are calculated as below:

sum = 5 +たす 1 +たす 9 +たす 2 +たす 3 +たす 5 +たす 7 +たす 8 +たす 9 +たす 6 +たす 1 +たす 8 = 64

입력

The input consists of a few test cases. For each test case, the first line of input is a positive integer n (n <= 10) that determines the dimension of the triangle. Each of the next n lines contains 1 to n integers respectively that will fill the isosceles right triangle. Input is terminated by a case where n is 0.

출력

Each line of output will start with “Case #:” where # is replaced by the case number. Then you have to output the sum of the outer numbers of the triangle.

제한

예제 입력 1

5
5 
1 8 
9 6 1 
2 7 2 6 
3 5 7 8 9
3
1 
2 3
4 5 6
0

예제 출력 1

Case #1:64 
Case #2:21

힌트

출처

ICPC > Regionals > Asia Pacific > Malaysia > Malaysia National Programming Contest > Al-Khawarizmi National Programming Contest 2016 J번

  • 빠진 조건을 찾은 사람: jh05013
(追記) (追記ここまで)

출처

대학교 대회

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

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