Computer Science, asked by gattunaveen1515, 13 hours ago

onery For his coming 60th Birthday Michael wants to decorate his house to plans to buy exactly N Balloons. Michael has only one nearest stationery called Weird Stationery. Ther available in that shop. If you buy X Balloons of kind A then we must pay A*X^2 If you buy Y Balloons of kind B then we must pay B*Y^2 Help Michael in buying ballons with minimal cost Input Format : Each test case is described in a single line containir integers N,A,B. JavaScript​

Answers

Answered by shreyasspatil2008
0

Answer:

toroP00oxp ohhuuguyu6

Answered by shilpa85475
2

Ther available in that shop. If you buy X Balloons of kind A then we must pay A*X^2

If you buy Y Balloons of kind B then we must pay B*Y^2

Explanation:

public class abc

{

static int abc(int[] ar)

{

 int maxCandleHeight = Integer.MIN_VALUE;

 int maxCandleFreqCount = 0;

 for (int i = 0; i < ar.length; i++) {

  if (ar[i] == maxCandleHeight) {

   maxCandleFreqCount++;

  }

  if (ar[i] > maxCandleHeight) {

   maxCandleHeight = ar[i];

   maxCandleFreqCount = 1;

  }

 }

 return maxCandleFreqCount;

}

public static void main(String[] args) {

 Scanner sc = new Scanner(System.in);

 int M = sc.nextInt();

 int a[] = new int[M];

 for (int i = 0; i < M; i++) {

  a[i] = sc.nextInt();

 }

 System.out.println(birthdayCakeCandles(a));

 sc.close();

}

}

Similar questions