#K95817. Maximum Balanced Teams
Maximum Balanced Teams
Maximum Balanced Teams
Given three integers \(p\), \(q\), and \(r\) representing the total number of participants, the number of males, and the number of females respectively, your task is to compute the maximum number of balanced teams that can be formed. A balanced team consists of exactly one male and one female.
The number of balanced teams that can be formed is given by the formula: \(T = \min(q, r)\). Note that although \(p\) represents the total number of participants, it may include extra participants who cannot be paired.
inputFormat
A single line containing three space-separated integers: (p) (q) (r), where (p) is the total number of participants, (q) is the number of males, and (r) is the number of females.
outputFormat
Output a single integer representing the maximum number of balanced teams that can be formed.## sample
12 5 7
5
</p>