You’re given N and an integer X, the place N represents the variety of cube. It’s a must to prepare these dices in such a method that the seen variety of faces are as minimal as doable and the sum of seen faces is as most as doable. The duty is to examine if the sum of values on the seen faces is at the very least X or not.
Strategy: The issue is commentary based mostly and might be solved by utilizing the Grasping Strategy for getting the utmost doable sum. For extra clarification observe the under illustration.
The issue might be solved by Grasping method for getting most doable sum. We’ll see some circumstances under and can attempt to make a mathematical components for calculating sum utilizing some observations. Allow us to see some circumstances under:
Construction of 1 cube
Based on grasping method for making most doable sum, We’ve got to place 1 mark of cube on base floor, In order that the seen faces can be 2, 3, 4, 5, 6. Most doable sum on this case can be 20.
Construction of two dices
In construction of two cube, For making seen faces minimal as doable, We’ve got to merge each cube, which is able to decrement a visual face of each dices and a face can be put as base. In order that whole 2 faces can be invisible for every cube. For maximizing sum, We’ve got to selected these 2 invisible faces having minimal values, That are 1 and a pair of. Seen faces of each cube can be 3, 4, 5 and 6. Complete sum on this case = {3 + 4 + 5 + 6} + {3+ 4 + 5 + 6} = 18 + 18 = 36.
Construction of three dices
For maximizing sum and minimizing seen variety of faces, It’s optimum to make three invisible faces(1, 2, 3) of 1 cube and two (1, 2) for 2 dices. For optimum sum now we have to make invisible faces of lowest values first. Allow us to see the sum gained on this construction.
Format of Rationalization is as:
Cube quantity: {Complete faces of cube} – {Invisible faces} = {Seen faces} = Sum of seen faces
Cube 1: {1, 2, 3, 4, 5, 6} – {1, 2, 3}={4, 5, 6}=4 + 5 + 6 = 15
Cube 2: {1, 2, 3, 4, 5, 6} – {1, 2}={3, 4, 5, 6}=3 + 4 + 5 + 6 = 18
Cube 3: {1, 2, 3, 4, 5, 6} – {1, 2}={3, 4, 5, 6}=3 + 4 + 5 + 6 = 18
Complete most sum=18 + 18 + 15 = 51. It may be verified that it’s the most sum such that seen faces needs to be as minimal as doable.
Struture of 4 dices
For minimizing seen faces, We will make at most 3 invisible faces for every cube, Similar might be seen within the image above. For maximizing sum, 1, 2 and three should be as invisible faces and 4, 5 and 6 needs to be seen faces of every cube. On this case, Most sum can be = {4, 5, 6} + {4, 5, 6} + {4, 5, 6} + {4, 5, 6} = 15 + 15 + 15 + 15 = 60, Which is most doable.
Construction of seven dices
Three dices at base degree may have seen faces as 5 and 6 and one cube at base degree may have 4, 5, 6 as seen faces. The association of higher three dices fifth, sixth and seventh will observe the case of N = 3.
Stage 1:
Cube 1: {1, 2, 3, 4, 5, 6} – {1, 2, 3, 4}={5, 6} = 5 + 6 = 11
Cube 2: {1, 2, 3, 4, 5, 6} – {1, 2, 3, 4} = {5, 6} = 5 + 6 = 11
Cube 3: {1, 2, 3, 4, 5, 6} – {1, 2, 3, 4} = {5, 6} = 5 + 6 = 11
Cube 4: {1, 2, 3, 4, 5, 6} – {1, 2, 3} = {4, 5, 6} = 4 + 5 + 6 = 15
Stage 2:
Cube 5: {1, 2, 3, 4, 5, 6} – {1, 2} = {4, 5, 6} = 4 + 5 + 6 = 15
Cube 6: {1, 2, 3, 4, 5, 6} – {1, 2} = {3, 4, 5, 6} = 3+ 4 + 5 + 6 = 18
Cube 6: {1, 2, 3, 4, 5, 6} – {1, 2} = {3, 4, 5, 6} = 3 + 4 + 5 + 6 = 18
whole most doable sum 11+ 11 + 11 + 15 + 15 + 18 + 18 = 99
Construction of 8 dices
All of the 4 dices current at degree 1, May have solely 2 seen faces 5 and 6. Whereas all of the 4 dices at degree 2 may have three seen faces 4, 5 and 6.
Stage 1:
Cube 1: {1, 2, 3, 4, 5, 6} – {1, 2, 3, 4} = {5, 6} = 5 + 6 = 11
Cube 2: {1, 2, 3, 4, 5, 6} – {1, 2, 3, 4} = {5, 6} = 5 + 6 = 11
Cube 3: {1, 2, 3, 4, 5, 6} – {1, 2, 3, 4} = {5, 6} = 5 + 6 = 11
Cube 4: {1, 2, 3, 4, 5, 6} – {1, 2, 3, 4} = {5, 6} = 5 + 6 = 11
Stage 2:
Cube 5: {1, 2, 3, 4, 5, 6} – {1, 2, 3} = {4, 5, 6} = 4 + 5 + 6 = 15
Cube 6: {1, 2, 3, 4, 5, 6} – {1, 2, 3} = {4, 5, 6} = 4 + 5 +6 = 15
Cube 7: {1, 2, 3, 4, 5, 6} – {1, 2, 3} = {4, 5, 6} = 4 + 5 + 6 = 15
Cube 8: {1, 2, 3, 4, 5, 6} – {1, 2, 3} = {4, 5, 6} = 4 + 5 + 6 = 15
Complete most sum: 11 + 11 + 11 + 11 + 15+ 15 + 15 + 15 = 104
Observations: From the above observations, We will conclude some mathematical circumstances for calculating most sum on N dices:
- If N = 1, 2, 3, 4 then by following grasping method most sum can be 20, 36, 51, 60 respectively
- Initialize ans = (N-4)*11
- If (Npercent4==0), ans += 15*4
- else If (Npercent4==1), ans+=15*3+20
- else If (Npercent4==2), ans+=15*2+18*2
- else, ans+=15*2+18*2
Beneath is the implementation of the above method.