For example, I have a reference number a = 15
and b= 3
.
- If
x=2
,f(a,b,x) = 1
because if one divide 15 into 3 parts, the number 2 is in the first part. - If
x=7
,f(a,b,x) = 2
because if one divide 15 into 3 parts, the number 7 is in the second part. - If
x=15
,f(a,b,x) = 3
because if one divide 15 into 3 parts, the number 15 is in the third part. - If x<0 or >15 the results are irrelevant to me.
Is there any built-in function like this?