To solve your problem you may use application FF-JW_02-8(shooting from a cannon at sparrows) from 1, that satisfies your Constraints(including Input Constraints) and Objective. you must run the app in variant "By Output Resource" with input data(in text file): 7 13 0 6 200 200 0 1 5 0 1 1 0 2 2 0 1 2 0 3 1 0 1 3 1 4 200 0 2 4 2 4 200 0 3 5 3 4 200 0 1 6 1 5 200 0 1 7 2 5 200 0 2 8 2 5 200 0 3 9 4 6 15 0 1 10 5 6 10 0 1 11 0 4 200 1 1 12 0 5 200 1 1 13