Tap here to switch tabs
Problem
Submissions

Problem: Maximum Multiplication Score

Try to solve the Maximum Multiplication Score problem.

Statement

You are given an integer array a of size 44 and an integer array b of size at least 44.

You need to choose four indices i0,i1,i2,i_0, i_1, i_2, and i3i_3 such that 0≤i0<i1<i2<i3<0 \leq i_0 < i_1 < i_2 < i_3 < b.length.

The score of the chosen indices is defined as:
‘a[0]⋅b[i0]+a[1]⋅b[i1]+a[2]⋅b[i2]+a[3]⋅b[i3]‘`a[0] \cdot b[i_0] + a[1] \cdot b[i_1] + a[2] \cdot b[i_2] + a[3] \cdot b[i_3]`

Return the maximum score you can achieve.

Constraints:

  • a.length =4= 4

  • 4≤4 \leq b.length ≤105\leq 10^5

  • −105≤-10^5 \leq a[i], b[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Multiplication Score

Try to solve the Maximum Multiplication Score problem.

Statement

You are given an integer array a of size 44 and an integer array b of size at least 44.

You need to choose four indices i0,i1,i2,i_0, i_1, i_2, and i3i_3 such that 0≤i0<i1<i2<i3<0 \leq i_0 < i_1 < i_2 < i_3 < b.length.

The score of the chosen indices is defined as:
‘a[0]⋅b[i0]+a[1]⋅b[i1]+a[2]⋅b[i2]+a[3]⋅b[i3]‘`a[0] \cdot b[i_0] + a[1] \cdot b[i_1] + a[2] \cdot b[i_2] + a[3] \cdot b[i_3]`

Return the maximum score you can achieve.

Constraints:

  • a.length =4= 4

  • 4≤4 \leq b.length ≤105\leq 10^5

  • −105≤-10^5 \leq a[i], b[i] ≤105\leq 10^5