تم الحل ✓
categoryالفيزياء
schoolبكالوريوس
event_available2026-07-15
السؤال
Transcribed Image Text:
5 Refreshment
The Pan Am 73 flight from Bombay to New York en route Karachi and Frankfurt was hijacked by a few Palestinian
terrorists at the Karachi International Airport.
Despite the alarming situation prevailing inside the flight, the senior flight purser Neerja Banhot had to wither her fear and
rise to the occasion to take extra care of her passengers on board.
Firstly, she and her crew decided to provide food and drinks to the passengers. Given n the number of rows of seats in
the aircraft and the total number of people in each row, can you determine the total number of passengers in the flight.
Input Format
The first line of input consists of an integer n, corresponding to the number of rows in the aircraft.
Next line consists of the number of people in each row separated by a space.
Output Format
The first line of output consists of n integers corresponding to the number of people in each row.
The second line of output consists of an integer corresponding to the total number of people in the
aircraft.
Print Invalid Input and terminate the process of getting inputs if any of the inputs is not a positive
number.
Refer sample input and output for further specifications.
Sample Testcases
Testcase 1 Input
5
12 28 30 20 45
Testcase 1 Output
12 28 30 20 45
135
Testcase 2 Input
-6
Testcase 2 Output
Invalid Input
Testcase 3 Input
10
5
1 2 -3
Testcase 3 Output
Invalid Input
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.