Ready to begin
No records have been processed. Start with Next step.
We want to know whether some student achieves the maximum in every subject. Finding the maximum four times is the same task with a different field each time. This is a good use for a parameterized procedure.

MaxMaths = MaxMarks(Scores, "Mathematics")
MaxPhysics = MaxMarks(Scores, "Physics")
MaxChemistry = MaxMarks(Scores, "Chemistry")
MaxTotal = MaxMarks(Scores, "Total")
SubjectMaxSum = MaxMaths + MaxPhysics + MaxChemistry
HasCommonTopper = (MaxTotal == SubjectMaxSum)Read the current record, check the explanation, and watch the variables. Use Back to revisit any step.
Ready
No records have been processed. Start with Next step.
Start at the first step. Watch the current row and the values we remember.
Every student’s Mathematics mark is at most 97, Physics at most 92, and Chemistry at most 97. So no total can exceed 286. To reach 286, a student must reach every one of those subject maxima: a deficit in one subject cannot be cancelled by exceeding another maximum.
The actual largest total is 281, earned by Rahul with 97,92,92. His Chemistry mark is five below the Chemistry maximum 97, which explains the gap 286−281=5. Nobody achieves all subject maxima in these cards.
Procedure MaxMarks(Rows, Field)
if (Rows is empty) { report "No maximum"; stop }
Best = first row[Field]
for each remaining row X in Rows {
if (X[Field] > Best) { Best = X[Field] }
}
return Best
End ProcedureHasCommonTopper means at least one student reaches every maximum. It does not establish that the student is unique. Check that Total equals the sum of the three subjects before using this reasoning.
What is the sum of subject maxima?
97+92+97=286.
Is 286 an actual student total?
No. It is an upper bound assembled from potentially different students.
What does equality of MaxTotal and SubjectMaxSum establish?
At least one student reaches all subject maxima, assuming totals are consistent.
Why store each procedure result in a separate variable?
Later calls return new answers. Saved variables keep all four values available for the final comparison.