The values are match with the regions,
0 -> [0,60)
100 -> [60,120)
200 -> [120,180)
...
If I have a value 160, the program should return 200, because 160 is in (120, 180).
Is there any fast way to do this ?
It would be better to use the Java to describe.
Thanks.
UPDATE:
1.Maybe there are a large of resulting labels, like this:
0, 1, 2 , ... i ..., (i++)
2.The range of regions aren't always increase by 60.
[0, 60)
[60, 100)
...
With regions of equal length you could specify the result values that correspond to the regions in an array and calculate the array index based on the input value like this: