A Civil Architect is working on a plan of residential independent houses in a private society. The vic square meter, the area may differ from site to site, as given in the below image: 10 6 5 8 11 7 3 9 8 4 3 2 7 9 4 2 CH Now they want to demolish some illegally constructed buildings diagonally. For every diagonal destruction, some cost is involved. So the civil architect wants to sum up the entire cost of destroying of all diagonals in the reverse diagonal sequence. Constraint: 0
A Civil Architect is working on a plan of residential independent houses in a private society. The vic square meter, the area may differ from site to site, as given in the below image: 10 6 5 8 11 7 3 9 8 4 3 2 7 9 4 2 CH Now they want to demolish some illegally constructed buildings diagonally. For every diagonal destruction, some cost is involved. So the civil architect wants to sum up the entire cost of destroying of all diagonals in the reverse diagonal sequence. Constraint: 0
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Please code the question in c or c++ or java or python or R or javascript ( any one of the following)
![A Civil Architect is working on a plan of residential independent houses in a private society. The ty iss
square meter, the area may differ from site to site, as given in the below image:
10
Deloi
11
7
5
3
8 9
6
9
4
2
4
8
3
7
2
Constraint:
0<S<150
oryCh
Now they want to demolish some illegally constructed buildings diagonally. For every diagonal destruction, some cost is involved. So the civil architect wants to
sum up the entire cost of destroying of all diagonals in the reverse diagonal sequence.
▷
square in shape. Each site has a total area calculated in
If the cost of destruction of each square flat is provided in the form of the matrix, Write a program that calculates the total cost of destruction of all the diagonals
of the matrix.
CH65
Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings while reading the input or while printing, as these contribute to the
standard output.
Input Format:
The first line of input contains an integer, S, the size of the society.
The next S line of input contains S site areas each separated by a single white space.
Sample Input1:
3
123
456
789
Output Format:
The output should contain the total cost of destruction of all diagonals in the reverse diagonal sequence, each separated by a single white space. Print the cost of
destruction from diagonals from top left corner to the bottom right corner.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1c4e5916-0a73-4b8b-bb63-14987bb1d822%2F6fb73efe-c78a-495c-813c-1c0dc75e15ac%2Fq8alq1_processed.jpeg&w=3840&q=75)
Transcribed Image Text:A Civil Architect is working on a plan of residential independent houses in a private society. The ty iss
square meter, the area may differ from site to site, as given in the below image:
10
Deloi
11
7
5
3
8 9
6
9
4
2
4
8
3
7
2
Constraint:
0<S<150
oryCh
Now they want to demolish some illegally constructed buildings diagonally. For every diagonal destruction, some cost is involved. So the civil architect wants to
sum up the entire cost of destroying of all diagonals in the reverse diagonal sequence.
▷
square in shape. Each site has a total area calculated in
If the cost of destruction of each square flat is provided in the form of the matrix, Write a program that calculates the total cost of destruction of all the diagonals
of the matrix.
CH65
Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings while reading the input or while printing, as these contribute to the
standard output.
Input Format:
The first line of input contains an integer, S, the size of the society.
The next S line of input contains S site areas each separated by a single white space.
Sample Input1:
3
123
456
789
Output Format:
The output should contain the total cost of destruction of all diagonals in the reverse diagonal sequence, each separated by a single white space. Print the cost of
destruction from diagonals from top left corner to the bottom right corner.
![Sample Output 7:3
1615149
Explanation1:
Here, total size of the society is 3.
So, the total cost of destruction in reverse diagonal sequence are 1, (2+4), (3+5+7), (6+8) 9
Deloite
Therefore, it will print 1, 6, 15, 14, and 9 as an output
Sample Input 2:
4
1234
5678
9 10 11 12
13 14 15 16
Sample Output 2:
17 18 34 33 27 16
C1165335
Defoin
Therefore, it will print 1, 7, 18, 34, 33, 27, and 16 as an output
viso
Explanation 2:
Here, the total size of the society is 4.
So, the total cost of destruction in reverse diagonal sequence are 1, (2+5), (3+6+9), (4+7+10+13), (8+11+14), (12+15), and 16.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1c4e5916-0a73-4b8b-bb63-14987bb1d822%2F6fb73efe-c78a-495c-813c-1c0dc75e15ac%2Fh6u8q7_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Sample Output 7:3
1615149
Explanation1:
Here, total size of the society is 3.
So, the total cost of destruction in reverse diagonal sequence are 1, (2+4), (3+5+7), (6+8) 9
Deloite
Therefore, it will print 1, 6, 15, 14, and 9 as an output
Sample Input 2:
4
1234
5678
9 10 11 12
13 14 15 16
Sample Output 2:
17 18 34 33 27 16
C1165335
Defoin
Therefore, it will print 1, 7, 18, 34, 33, 27, and 16 as an output
viso
Explanation 2:
Here, the total size of the society is 4.
So, the total cost of destruction in reverse diagonal sequence are 1, (2+5), (3+6+9), (4+7+10+13), (8+11+14), (12+15), and 16.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY