Are those numbers integers or float? Which ones are inputs which results?
If all inputs and outputs are integer, and that is every state you can get, just make simple graph, that checks for NSP and NS inputs, then gives result.
For eg:
in sequence check:
if nsp=4 and ns=2 then index = 0
if nsp=3 and ns=3 then index = 1
if nsp=4 and ns=4 then index = 2
put in 3 arrays all 3 results:
Rst NS2 = 3 , 2, 1]
Rst NS3 = 2 , 3, 4]
Rst NS4 = 6 , 6, 8]
then get results array[index] for each result
but i am assuming what is input and what is output also that all are integers.