Farmer John and Bessie the cow love to exchange math puzzles in their free time. The last puzzle FJ gave Bessie
was quite difficult and she failed to solve it. Now she wants to get even with FJ by giving him a challenging puzzle.
Bessie gives FJ the expression (B+E+S+S+I+E)(G+O+E+S)(M+O+O), containing the seven variables B,E,S,I,G,O,M
(the "O" is a variable, not a zero). For each variable, she gives FJ a list of up to 500 integer values the variable can
possibly take. She asks FJ to count the number of different ways he can assign values to the variables so the entire
expression evaluates to a multiple of 7.
Note that the answer to this problem can be too large to fit into a 32-bit integer, so you probably want to use 64-bit
integers (e.g., "long long"s in C or C++).
七个变量B,E,S,I,G,O,M;使得(B+E+S+S+I+E)(G+O+E+S)(M+O+O)被7整除的方案有多少种.