---
title: "Maximizing the Second Largest of Five Distinct Integers"
organization: "NityaDhi Digital Mathematics Lab (Asa Edtech Private Limited)"
url: "https://www.nityadhi.com/problems/hard-c6-w1-05"
board: "CBSE"
grade: "Class 6"
published_at: "2026-11-24T13:30:00+05:30"
---

# Maximizing the Second Largest of Five Distinct Integers

The sum of $5$ distinct integers is $12$. If the largest integer is $18$ and the smallest integer is $-7$, what is the maximum possible value of the second largest integer?

## Textbook Solution

**Step 1: Order the five distinct integers.**
Let the five distinct integers in ascending order be:
$$-7 < a < b < c < 18$$
Here, $c$ is the second largest integer.

**Step 2: Find the sum of the three middle integers.**
$$(-7) + a + b + c + 18 = 12 \implies a + b + c + 11 = 12 \implies a + b + c = 1$$

**Step 3: Maximize $c$ by minimizing $a$ and $b$.**
Since $a$ and $b$ are distinct integers strictly greater than $-7$, their smallest possible values are:
$$a = -6, \quad b = -5$$

**Step 4: Compute $c$ and check the upper bound.**
$$c = 1 - (-6) - (-5) = 1 + 6 + 5 = 12$$
Since $12 < 18$, the ordering $-7 < -6 < -5 < 12 < 18$ is valid and all five integers are distinct.
**Final Answer:** $12$.

## Vedic Shortcut

**Extremal Packing Strategy:** To make one unknown as large as possible in a fixed sum, push every other variable as far left (negative) as the rules allow.

Remaining sum for $a, b, c$ is $12 - (18 - 7) = 1$. Pack $a, b$ tightly against $-7$ as $-6, -5$ (sum $-11$). Then $c = 1 - (-11) = 12$.

## Common Mistakes

1. **Assuming all integers must be positive or non-negative:** Since the problem specifies *integers* and gives $-7$, $a$ and $b$ can also be negative.
2. **Allowing duplicates ($a = b = -6$ or $a = -7$):** The word *distinct* forbids repeating $-7$ or choosing $a = b$.