Points for ranking 1st through 9th:

`max(0, (10-r) * 10) + max(0, (4-r) * 10)`

points for size of tournament:

`((1 + if(n > 9, 1) + if(n > 18, 1) + if(n > 24, 1)) * 5)`

sum of the previous two multiplied by the buy-in cost:

`(...) * bc`

add number of hits:

`((...) * bc) + nh`

Gives:

`(max(0, (10-r) * 10) + max(0, (4-r) * 10) + ((1 + if(n > 9, 1) + if(n > 18, 1) + if(n > 24, 1)) * 5)) * bc + nh`