For this Question: Blue Ranger hates palindromic strings and he is also jealous of Red Ranger. So to test Red Ranger he gives him a task. Given N and M, Red Ranger must find a string of length N and containing at max M distinct english alphabets such that the string contains minimum substrings that are palindromes. As there can be many such strings Blue Ranger asks him to simply tell the minimum possible number of substrings in the optimal string that are palindromes. 
Palindrome is a string that can be read in the same way in both left-to-right and right-to-left directions.Input contains two integers N and M.

Constraints:
1 <= N <= 100000
1 <= M <= 100Print a single integer that is the minimum possible number of substrings in the optimal string that are palindromes.Sample Input 1
3 15

Sample Output 1
3

Explanation: optimal string can be "abc" which has three substrings that are palindromes.

Sample Input 2
3 1

Sample Output 2
6

Explanation: optimal string can be "aaa" which has 6 substrings that are pallindromes., I have written this Solution Code: n,m = [int(x) for x in input().split()]
if m>2 or m>=n:
	print(n)
elif m==1:
	res = n*(n+1)//2
	print(res)
else:
	res = 2*(n-1)
	print(res), In this Programming Language: Python, Now tell me if this Code is compilable or not?