Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need the solution (the code ) 2:15 4G 12 codeforces.com ---Private D. The Diagonals Game time limit per test 2 seconds memory limit per

i need the solution (the code )
image text in transcribed
2:15 4G 12 codeforces.com ---Private D. The Diagonals Game time limit per test 2 seconds memory limit per test: 256 megabytes input: standard input output standard output Tonsey loves mathematical games that depend on the calculation speed some gave his friends bodo and Rafayello a NxN gnd and asked them to calculate the sum of the numbers written in the primary diagonal and the sum of the numbers written in the secondary diagonal Bodo and Rafaello don't love this type of games so they asked you to solve it. Read the Notes for a better understanding Input The first line contains one integer N 3 SN S1000). The next lines contain Nintegers each, where the j - th number in the ith line is the number written in the cell ()A-1000 S S 1000) Output Print two integers separated by a space. The summation of the primary diagonal and the summation of the secondary diagonal Example input 3 11 111 111 output Note This image shows the primary diagonal on a 4x4 gird: This image shows the secondary diagonal on a 4x4 gird

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Make A Database In Historical Studies

Authors: Tiago Luis Gil

1st Edition

3030782409, 978-3030782405

More Books

Students also viewed these Databases questions