Codu is fond of vehicle numbers. Codu wants to compute the number of vehicles can be registered in his state. A vehicle normally has a regis
Codu is fond of vehicle numbers. Codu wants to compute the number of vehicles can be registered in his state. A vehicle normally has a registration
number like ST 01 AB 1234. Each registration number has four parts, separated by spaces. The first part has two letters common for all cars in the state.
The next two-digit number is the number of the district where the car is registered within the state. It is always two digits, and may have a leading zero.
After that, the next part consists of two letters (AB), with each letter selected from a range, denoting the series and the last part is a 4-digit number (this will
always be four digits, even if it has leading zeroes). The entire registration number is unique to each vehicle. You have been given the number of districts in
state and a range of letters (to be used in the series) and a set of digits that can be used for forming a vehicle registration number. You need to find the
maximum number of vehicles that can be registered in the state subject to the rules.
1 <= Number of districts < 100
A <= Range of alphabets <= Z
0 <= Range of digits <= 9
Width of district column will always be equal to 2.
Ex-District 1 will be represented as 01.