Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Onze excuses dat er iets mis is gegaan. Wat is er gebeurd?

book
Maximize the Expression

Bill studies in a school and he adores Maths. His class has been studying arithmetic expressions. On the last class the teacher wrote three positive integers a, b, c on the blackboard. The task was to insert signs of operations + and *, and probably brackets between the numbers so that the value of the resulting expression is as large as possible.

Possible variants:

  • a+b*c=v1
  • a*(b+c)=v2
  • a*b*c=v3
  • (a+b)*c=v4

Note that you can insert operation signs only between a and b, and between b and c, that is, you cannot swap integers. For instance, in the given sample you cannot get expression (a+c)*b.

Given an integers a, b and c. Return maximum value of the expression that you can obtain.

Example 1

Input:

a = 1, b = 2, c = 3

Output:

9
main.c

main.c

c

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt