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: #pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountll
#define m_p make_pair
#define infi 1e18+1
#define eps 0.000000000001
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
string char_to_str(char c){string tem(1,c);return tem;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class T>//usage rand<long long>()
T rand() {
    return uniform_int_distribution<T>()(rng);
}
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template<class T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
 
//////////////
auto clk=clock();
#define all(x) x.begin(),x.end()
#define S second
#define F first
#define sz(x) ((long long)x.size())
#define int long long  
#define f80 __float128
#define pii pair<int,int>
/////////////

signed main()
{
	fastio;
	#ifdef ANIKET_GOYAL
		freopen("inputf.in","r",stdin);
		freopen("outputf.in","w",stdout);
	#endif
	int n,m;
	cin>>n>>m;
	if(n==1)
		cout<<1;
	else
		if(m==1){
			cout<<(n*(n+1))/2;
		}
		else{
			if(m==2)
				cout<<(2*n-2);
			else
				cout<<n;
		}
	#ifdef ANIKET_GOYAL
		// cout<<endl<<endl<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
	#endif
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?