Created
August 16, 2020 04:54
-
-
Save muthhukumar/e7e2169bdbb1734408c4940a41b169af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import product | |
def Perm(num): | |
return sum([int(i) for i in num]) | |
first, second = map(int, input().split()) | |
rep = int(input()) | |
arr = [str(i) for i in range(first, second + 1)] | |
total_count = 0 | |
for i in product(arr, repeat=rep): | |
if Perm(i) % 2 == 0: | |
total_count += 1 | |
print(total_count % 1000000007) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment