I have two numbers(A,B), I want to combine the numbers into one(C)
The constraints are
A's range = 0 to 3 (4 values)
B's range = 0 to 900 (900 values)
- C must have a maximum of 3 digits only.
Example:
Input: A=2, B=635
Calculate C, lets say C = 2 + 635 = 637 (only 3 digits)
Given C = 637, Extract A = 2 & B = 635.
===============
A's range is fixed at 4.
B's range can be reduced from 900, but cannot go below 500.
C MUST be 3 digits only
If $C$ has a maximum of $3$ digits, then it's impossible. There are only $1000$ possibilities ($1999$ if it can be negative), but it would need to cover $4\cdot 900=3600$ different combinations of $A$ and $B$. There just isn't room.
If you allow four digits, then $C=1000A+B$ works.