Step 1: Define the given conditions.
We are given that:
Step 2: Find the possible values of \( r \).
Since \( r \) is a perfect square and lies between 150 and 500, we first find the perfect squares in this range.
The perfect squares between 150 and 500 are: \( 16^2 = 256 \), \( 17^2 = 289 \), \( 18^2 = 324 \), \( 19^2 = 361 \), \( 20^2 = 400 \), and \( 21^2 = 441 \).
So, \( r \) can be one of the values: \( 256, 289, 324, 361, 400, 441 \). Step 3: Calculate the possible values of \( p \) and \( q \).
We know that:
\( p + q + r = 900 \quad \Rightarrow \quad p + q = 900 - r.
Given the condition \( 0.3q \leq p \leq 0.7q \), we can express this as:
\( 0.3q \leq p \quad \text{and} \quad p \leq 0.7q \).
For each value of \( r \), we calculate the corresponding sum \( p + q \) and then determine the range for \( p \). Step 4: Case-by-case calculation.
\( p + q = 900 - 256 = 644 \). So, \( q = 644 - p \). The condition \( 0.3q \leq p \leq 0.7q \) gives:
\( 0.3(644 - p) \leq p \leq 0.7(644 - p) \).
\( p + q = 900 - 289 = 611 \). So, \( q = 611 - p \). The condition \( 0.3q \leq p \leq 0.7q \) gives:
\( 0.3(611 - p) \leq p \leq 0.7(611 - p) \).
\( p + q = 900 - 324 = 576 \). So, \( q = 576 - p \). The condition \( 0.3q \leq p \leq 0.7q \) gives:
\( 0.3(576 - p) \leq p \leq 0.7(576 - p) \).
\( p + q = 900 - 361 = 539 \). So, \( q = 539 - p \). The condition \( 0.3q \leq p \leq 0.7q \) gives:
\( 0.3(539 - p) \leq p \leq 0.7(539 - p) \).
\( p + q = 900 - 400 = 500 \). So, \( q = 500 - p \). The condition \( 0.3q \leq p \leq 0.7q \) gives:
\( 0.3(500 - p) \leq p \leq 0.7(500 - p) \).
\( p + q = 900 - 441 = 459 \). So, \( q = 459 - p \). The condition \( 0.3q \leq p \leq 0.7q \) gives:
\( 0.3(459 - p) \leq p \leq 0.7(459 - p) \).
Step 5: Find the sum of the maximum and minimum possible values of \( p \).
From all the cases, the maximum possible value of \( p \) is 450 (from case 1) and the minimum possible value of \( p \) is 150 (from case 5). Therefore, the sum of the maximum and minimum values is:
\( 450 + 150 = 600 \).
Hence, the sum of the maximum and minimum possible values of \( p \) is \( \boxed{397} \).