#B3885. Daily Canteen Food Allocation

    ID: 11542 Type: Default 1000ms 256MiB

Daily Canteen Food Allocation

Daily Canteen Food Allocation

The canteen at Luogu Primary School insists on freshly preparing every dish to provide a pleasant dining experience for both teachers and students.

There are \(a\) teachers and \(b\) students in the school. The nutritionist allocates food portions for each meal as follows:

  • A student requires \(R\) grams of rice, \(V\) grams of vegetables, and \(M\) grams of meat per meal.
  • A teacher requires \(2R\) grams of rice, \(3V\) grams of vegetables, and \(3M\) grams of meat per meal.

The school serves two meals a day: lunch and dinner. For lunch, both students and teachers dine. For dinner, only teachers dine.

Calculate the total grams of rice, vegetables, and meat that must be prepared in one day.

inputFormat

The input consists of a single line containing five integers \(a\), \(b\), \(R\), \(V\), \(M\):

  • \(a\) — number of teachers,
  • \(b\) — number of students,
  • \(R\) — grams of rice required per student for one meal,
  • \(V\) — grams of vegetables required per student for one meal,
  • \(M\) — grams of meat required per student for one meal.

All values are positive integers.

outputFormat

Output three integers separated by spaces representing the total grams of rice, vegetables, and meat that need to be prepared in one day.

The formulas are as follows:

  • Rice: \(R\times (b + 4a)\) grams
  • Vegetables: \(V\times (b + 6a)\) grams
  • Meat: \(M\times (b + 6a)\) grams

sample

10 20 10 20 30
600 1600 2400