S = (c1-s1)×(m1-p1) +...+ (N-sN)×(mN-N), ............
1' £
2' £
... £ N',
k' = i k = 1 ... N i = 1 ... N.
:
N > 0.
­ data:
tovs: ': osts: ':
data , 500, 200 data , 2500, 100
data , 400, 250 data , 2000, 150
data , 200, 600 data , 1200, 200
data , 800, 100 data , 2000, 0
data , 0, 0 data , 0, 0
 
.
-: .
­ : , - .
: tv(l:N), s(l:N), m(l:N), (1:N), p(l:N). N = 200, , ­ .
⻠ '
N
= 100 N = 100
tv[1:N],s[1:N],m1l:N] dim tv$(N),s(N),m(N)