 # PM2A Editorial

Author: Chandan Boruah
Tester: Chandan Boruah
Editorialist: Chandan Boruah

EASY

### PREREQUISITES:

Simple Math, Brute Force.

### PROBLEM:

Given count of red balls, count of blue balls and count of reflective glasses. Print the number of ways in which the balls

### QUICK EXPLANATION:

Find the number of ways in which red balls can be reflected, rest of the glasses can be used to reflect the blue balls. Count such number of ways.

### EXPLANATION:

Iterate till the minimum of red balls and blue balls. Use the glasses to reflect from 0 to min(red,blue) balls. If its possible to reflect the blue balls with the glasses that are left in every iteration it should be counted.

### AUTHOR’S SOLUTION IN C#:

``````using System;
using System.Collections.Generic;
class some
{
public static void Main()
{
while(t>0)
{
t--;
int red=int.Parse(ss);
int blue=int.Parse(ss);
int glasses=int.Parse(ss);
int count=0;
for(int i=0;i<=Math.Min(red,glasses);i++)
{
int glass=glasses;
glass-=i;
if(blue>=glass)count++;
}
Console.WriteLine(count);
}
}
}
``````
//