Fitness Test in Indian Navy Problem Statement

The selection process in the Indian Navy includes a fitness test conducted in seawater, where a group of 3 trainees undergo a swimming test over three rounds. The oxygen level of each trainee after each round will be recorded in a 2D matrix/list OXYGEN of size 3 x 3.

The task is to calculate the average oxygen level for each trainee over the three rounds and select the ones with the highest average oxygen level as the fittest. If there is a tie in the highest average levels, all such trainees should be selected.

Rules:

1. Only consider oxygen levels in the range [1, 100] inclusive; otherwise, treat it as 0.
2. If the highest average oxygen level among trainees is less than 70, declare them as "Unfit".
3. Round the average oxygen level to the nearest integer.

Example:

Output:
Trainee1
Unfit
Trainee3
Explanation:
In this example, the highest average oxygen level is 70, which is acceptable. Trainees 1 and 3 have the same average value of 70. Trainee 2 is declared "Unfit" because their average is less than 70.

Input:

The first line of input contains an integer 'T', the number of test cases.
Each test case consists of 3 lines, each with 3 space-separated integers denoting the oxygen levels of each trainee after each round.

Output:

For each test case, output the numbers of the fittest trainee(s) in increasing order.
Print "Unfit" if the average oxygen level is below 70.
Output results for each test case on separate lines.

Constraints:

  • 1 ≤ T ≤ 100
  • 1 ≤ OXYGEN[i][j] ≤ 100, where OXYGEN[i][j] is the oxygen level of the i-th trainee after the j-th round.
  • Time Limit: 1 sec

Note:

You do not need to print anything. Just implement the given function.

AnswerBot
4mo

Calculate average oxygen levels of trainees in Indian Navy fitness test and select fittest based on rules.

  • Parse input to get oxygen levels of trainees after each round

  • Calculate average oxygen level fo...read more

Help your peers!
Select
Add answer anonymously...

TCS iON Software Developer Intern interview questions & answers

A Software Developer Intern was asked Q. Fitness Test in Indian Navy Problem Statement The selection process in the India...read more
A Software Developer Intern was asked Q. Nth Element Of Modified Fibonacci Series Given two integers X and Y as the first...read more
A Software Developer Intern was asked Q. Reverse Alternate Nodes in a Singly Linked List Given a singly linked list of in...read more

Popular interview questions of Software Developer Intern

A Software Developer Intern was asked Q1. Fitness Test in Indian Navy Problem Statement The selection process in the India...read more
A Software Developer Intern was asked Q2. Nth Element Of Modified Fibonacci Series Given two integers X and Y as the first...read more
A Software Developer Intern was asked Q3. Reverse Alternate Nodes in a Singly Linked List Given a singly linked list of in...read more
TCS iON Software Developer Intern Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits