Good evening/morning to all,
I am new to this cult of competitive programming, been practicing for about a month seriously, I encountered a problem ( mentioned in the title ) which gives 3 numbers and you've got to find an arithmetic of only + and * that produces the largest value. I use Python and here's my logic: a = int(input()) b = int(input()) c = int(input()) if max(a,b,c)==a: print(max(a*b*c,a*(b+c),a+b+c)) elif max(a,b,c)==b: print(max(a*b*c,b*(a+c),a+b+c)) else: print(max(a*b*c,c*(a+b),a+b+c))
when submitted, It got rejected when given the numbers 6,7 and 1. My program gave back 49, while the jury's gave back 48, which makes no sense to me. Some clarification please ?