Commit 92156147 authored by Gianluca Frison's avatar Gianluca Frison
Browse files

added lecture5_6 & ex05

parent 3e02e2f2
% In this script one solves the MDR (missing data recovery) problem
% A data vector f represented by a sparse (few nonzeros xs) expansion
% in a frame (here the discrete cosine transform DCT) Phi. f experiences
% a loss of information, its last n-m components are lost in b. The
% system Phi(1:m,:)*xr = b that would need to be solved to recover the
% coefficients xr is underdetermined and thus has infinitely many
% solutions. Since it is known that xs is sparse, one tries to
% find a sparse xr vector by solving the optimization problem
%
% min ||x||_0 subject to Ax = b, ||.||_0 denotes no. of nonzeros
%
% This is a combinatorial problem and NP hard. One replaces the ||.||_0
% norm by the ||.||_1 norm which encourages sparsity when minimized.
%
% (MDR) min ||x||_1 subject to Ax = b (x free)
%
% This problem can be rewritten as standard form LP and solved by
% Mehrotra's interior point method. Sparsity should be exploited
% Use m = 400, 350, 300
%
n = 500; % data size
m = 400; % available data size; may be changed
Phi = dctmtx(n); % get the frame
xs = zeros(n,1); % initialize x*
k = 10; % number of nonzeros in x*
rand('state',1011); % for reproducibility
p = randperm(60); % indices of nonzeros in x*
randn('state',11); % for reproducibility
xs(p(1:k)) = randn(k,1); % random values for x*
f = Phi*xs; % complete data vector v*
b = f(1:m); % available data b
A = Phi(1:m,:); % matrix A
subplot(4,1,1); % put all graphs in one figure
plot(1:n,f); % plot complete data
subplot(4,1,2);
plot(1:n,[b;zeros(n-m,1)]); % plot available data
%
% fill in here; set up the LP and solve with Matlab's linprog
%
subplot(4,1,3);
plot(1:n,Phi*xr); % plot recovered data
subplot(4,1,4);
plot(1:n,Phi*xr-f); % plot error
% IPM for LP, solving
% min c'*x
% s.t. A*x=b
% with A of size m times n
function [x,ff]=meh(A,c,b,x,m,n);
format long
inf=10^20;
eta=.99;
tol=10^(-8);
mu=1;
maxit=100;
s=1*ones(n,1);
la=zeros(m,1);
e=ones(n,1);
dxaf=zeros(n,1);
dlaf=zeros(m,1);
dsaf=dxaf;
X=diag(x);
S=diag(s);
L=[zeros(n) A' eye(n);A zeros(m) zeros(m,n);S zeros(n,m) X];
for k=1:maxit
if (mu>tol)
iter=k;
mu
f(k)=c'*x;
X=diag(x);
S=diag(s);
rb=A*x-b;
rc=A'*la+s-c;
XSe=x.*s;
if 0 % fully sparse
L=[zeros(n) A' eye(n);A zeros(m) zeros(m,n);S zeros(n,m) X];
%[dxaf;dlaf;dsaf]=L\[-rc;-rb;-XSe];
ll=L\[-rc;-rb;-XSe];
dxaf=ll(1:n);
dlaf=ll(n+1:n+m);
dsaf=ll(n+m+1:2*n+m);
else % augmented system
KKT = [-diag(s./x) A'; A zeros(m)];
% lll = KKT\[-rc+XSe./x;-rb];
[LL, UU, pp] = lu(KKT, 'vector'); % KKT matrix is symmetric, but LDL is not implemented in Octave (yet)
lll = [-rc+XSe./x;-rb];
lll = UU\(LL\(lll(pp)));
dxaf=lll(1:n);
dlaf=lll(n+1:n+m);
dsaf = (-XSe-s.*dxaf)./x;
end
if 1 % predictor-corrector IPM
mx=-x./dxaf;
ms=-s./dsaf;
alpaf=inf;
aldaf=inf;
for i=1:n
if (dxaf(i)<0)
alpaf=min(alpaf,mx(i));
end
if(dsaf(i)<0)
aldaf=min(aldaf,ms(i));
end
end
alpaf=min(1,alpaf);
aldaf=min(1,aldaf);
muaf(k)=(x+alpaf*dxaf)'*(s+aldaf*dsaf)/n;
sigema(k)=(muaf(k)/mu)^3;
Xaf=diag(dxaf);
Saf=diag(dsaf);
dd=-XSe-Xaf*Saf*e+sigema(k)*mu*e;
if 0 % fully sparse
% [dx;dla;ds]=L\[-rc;-rb;dd];
ll=L\[-rc;-rb;dd];
dx=ll(1:n);
dla=ll(n+1:n+m);
ds=ll(n+m+1:2*n+m);
else % augmented system
lll = [-rc-dd./x;-rb];
lll = UU\(LL\(lll(pp)));
dx=lll(1:n);
dla=lll(n+1:n+m);
ds = (dd-s.*dx)./x;
end
else % predictor IPM
dx = dxaf;
dla = dlaf;
ds = dsaf;
end
mx=-x./dx;
ms=-s./ds;
alpm=inf;
aldm=inf;
for i=1:n
if (dx(i)<0)
alpm=min(alpm,mx(i));
end
if(ds(i)<0)
aldm=min(aldm,ms(i));
end
end
alpm=min(1,alpm);
aldm=min(1,aldm);
alpk=min(1,eta*alpm);
aldk=min(1,eta*aldm);
x=x+alpk*dx;
ls=[la;s]+aldk*[dla;ds];
la=ls(1:m);
s=ls(m+1:m+n);
mu=x'*s/n;
end
end
iter
ff=c'*x;
%figure;
%plot(f),title('f'),xlabel('# of iteration');
param n := 679;
param m := 9;
param x : 1 2 3 4 5 6 7 8 9 10 :=
1 5 1 1 1 2 1 3 1 1 -1
2 5 4 4 5 7 10 3 2 1 -1
3 3 1 1 1 2 2 3 1 1 -1
4 6 8 8 1 3 4 3 7 1 -1
5 4 1 1 3 2 1 3 1 1 -1
6 8 10 10 8 7 10 9 7 1 1
7 1 1 1 1 2 10 3 1 1 -1
8 2 1 2 1 2 1 3 1 1 -1
9 2 1 1 1 2 1 1 1 5 -1
10 4 2 1 1 2 1 2 1 1 -1
11 1 1 1 1 1 1 3 1 1 -1
12 2 1 1 1 2 1 2 1 1 -1
13 5 3 3 3 2 3 4 4 1 1
14 1 1 1 1 2 3 3 1 1 -1
15 8 7 5 10 7 9 5 5 4 1
16 7 4 6 4 6 1 4 3 1 1
17 4 1 1 1 2 1 2 1 1 -1
18 4 1 1 1 2 1 3 1 1 -1
19 10 7 7 6 4 10 4 1 2 1
20 6 1 1 1 2 1 3 1 1 -1
21 7 3 2 10 5 10 5 4 4 1
22 10 5 5 3 6 7 7 10 1 1
23 3 1 1 1 2 1 2 1 1 -1
24 1 1 1 1 2 1 3 1 1 -1
25 5 2 3 4 2 7 3 6 1 1
26 3 2 1 1 1 1 2 1 1 -1
27 5 1 1 1 2 1 2 1 1 -1
28 2 1 1 1 2 1 2 1 1 -1
29 1 1 3 1 2 1 1 1 1 -1
30 3 1 1 1 1 1 2 1 1 -1
31 2 1 1 1 2 1 3 1 1 -1
32 10 7 7 3 8 5 7 4 3 1
33 2 1 1 2 2 1 3 1 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1 7 1 1 -1
80 4 1 1 2 2 1 2 1 1 -1
81 5 2 1 1 2 1 3 1 1 -1
82 3 1 1 1 2 2 7 1 1 -1
83 3 5 7 8 8 9 7 10 7 1
84 5 10 6 1 10 4 4 10 10 1
85 3 3 6 4 5 8 4 4 1 1
86 3 6 6 6 5 10 6 8 3 1
87 4 1 1 1 2 1 3 1 1 -1
88 2 1 1 2 3 1 2 1 1 -1
89 1 1 1 1 2 1 3 1 1 -1
90 3 1 1 2 2 1 1 1 1 -1
91 4 1 1 1 2 1 3 1 1 -1
92 1 1 1 1 2 1 2 1 1 -1
93 2 1 1 1 2 1 3 1 1 -1
94 1 1 1 1 2 1 3 1 1 -1
95 2 1 1 2 2 1 1 1 1 -1
96 5 1 1 1 2 1 3 1 1 -1
97 9 6 9 2 10 6 2 9 10 1
98 7 5 6 10 5 10 7 9 4 1
99 10 3 5 1 10 5 3 10 2 1
100 2 3 4 4 2 5 2 5 1 1
101 4 1 2 1 2 1 3 1 1 -1
102 8 2 3 1 6 3 7 1 1 1
103 10 10 10 10 10 1 8 8 8 1
104 7 3 4 4 3 3 3 2 7 1
105 10 10 10 8 2 10 4 1 1 1
106 1 6 8 10 8 10 5 7 1 1
107 1 1 1 1 2 1 2 3 1 -1
108 6 5 4 4 3 9 7 8 3 1
109 1 3 1 2 2 2 5 3 2 -1
110 8 6 4 3 5 9 3 1 1 1
111 10 3 3 10 2 10 7 3 3 1
112 10 10 10 3 10 8 8 1 1 1
113 3 3 2 1 2 3 3 1 1 -1
114 1 1 1 1 2 5 1 1 1 -1
115 8 3 3 1 2 2 3 2 1 -1
116 4 5 5 10 4 10 7 5 8 1
117 1 1 1 1 4 3 1 1 1 -1
118 3 2 1 1 2 2 3 1 1 -1
119 1 1 2 2 2 1 3 1 1 -1
120 4 2 1 1 2 2 3 1 1 -1
121 10 10 10 2 10 10 5 3 3 1
122 5 3 5 1 8 10 5 3 1 1
123 5 4 6 7 9 7 8 10 1 1
124 1 1 1 1 2 1 2 1 1 -1
125 7 5 3 7 4 10 7 5 5 1
126 3 1 1 1 2 1 3 1 1 -1
127 8 3 5 4 5 10 1 6 2 1
128 1 1 1 1 10 1 1 1 1 -1
129 5 1 3 1 2 1 2 1 1 -1
130 2 1 1 1 2 1 3 1 1 -1
131 5 10 8 10 8 10 3 6 3 1
132 3 1 1 1 2 1 2 2 1 -1
133 3 1 1 1 3 1 2 1 1 -1
134 5 1 1 1 2 2 3 3 1 -1
135 4 1 1 1 2 1 2 1 1 -1
136 3 1 1 1 2 1 1 1 1 -1
137 4 1 2 1 2 1 2 1 1 -1
138 3 1 1 1 2 1 1 1 1 -1
139 2 1 1 1 2 1 1 1 1 -1
140 9 5 5 4 4 5 4 3 3 1
141 1 1 1 1 2 5 1 1 1 -1
142 2 1 1 1 2 1 2 1 1 -1
143 3 4 5 2 6 8 4 1 1 1
144 1 1 1 1 3 2 2 1 1 -1
145 3 1 1 3 8 1 5 8 1 -1
146 8 8 7 4 10 10 7 8 7 1
147 1 1 1 1 1 1 3 1 1 -1
148 7 2 4 1 6 10 5 4 3 1
149 10 10 8 6 4 5 8 10 1 1
150 4 1 1 1 2 3 1 1 1 -1
151 1 1 1 1 2 1 1 1 1 -1
152 5 5 5 6 3 10 3 1 1 1
153 1 2 2 1 2 1 2 1 1 -1
154 2 1 1 1 2 1 3 1 1 -1
155 9 9 10 3 6 10 7 10 6 1
156 10 7 7 4 5 10 5 7 2 1
157 4 1 1 1 2 1 3 2 1 -1
158 3 1 1 1 2 1 3 1 1 -1
159 1 1 1 2 1 3 1 1 7 -1
160 4 1 1 1 2 2 3 2 1 -1
161 5 6 7 8 8 10 3 10 3 1
162 10 8 10 10 6 1 3 1 10 1
163 3 1 1 1 2 1 3 1 1 -1
164 1 1 1 2 1 1 1 1 1 -1
165 3 1 1 1 2 1 1 1 1 -1
166 1 1 1 1 2 1 3 1 1 -1
167 1 1 1 1 2 1 2 1 1 -1
168 6 10 10 10 8 10 10 10 7 1
169 8 6 5 4 3 10 6 1 1 1
170 5 8 7 7 10 10 5 7 1 1
171 2 1 1 1 2 1 3 1 1 -1
172 5 10 10 3 8 1 5 10 3 1
173 4 1 1 1 2 1 3 1 1 -1
174 5 3 3 3 6 10 3 1 1 1
175 1 1 1 1 1 1 3 1 1 -1
176 1 1 1 1 2 1 1 1 1 -1
177 6 1 1 1 2 1 3 1 1 -1
178 5 8 8 8 5 10 7 8 1 1
179 8 7 6 4 4 10 5 1 1 1
180 2 1 1 1 1 1 3 1 1 -1
181 1 5 8 6 5 8 7 10 1 1
182 10 5 6 10 6 10 7 7 10 1
183 5 8 4 10 5 8 9 10 1 1
184 1 2 3 1 2 1 3 1 1 -1
185 10 10 10 8 6 8 7 10 1 1
186 7 5 10 10 10 10 4 10 3 1
187 5 1 1 1 2 1 2 1 1 -1
188 1 1 1 1 2 1 3 1 1 -1
189 3 1 1 1 2 1 3 1 1 -1
190 4 1 1 1 2 1 3 1 1 -1
191 8 4 4 5 4 7 7 8 2 -1
192 5 1 1 4 2 1 3 1 1 -1
193 1 1 1 1 2 1 1 1 1 -1
194 3 1 1 1 2 1 2 1 1 -1
195 9 7 7 5 5 10 7 8 3 1
196 10 8 8 4 10 10 8 1 1 1
197 1 1 1 1 2 1 3 1 1 -1
198 5 1 1 1 2 1 3 1 1 -1
199 1 1 1 1 2 1 3 1 1 -1
200 5 10 10 9 6 10 7 10 5 1
201 10 10 9 3 7 5 3 5 1 1
202 1 1 1 1 1 1 3 1 1 -1
203 1 1 1 1 1 1 3 1 1 -1
204 5 1 1 1 1 1 3 1 1 -1
205 8 10 10 10 5 10 8 10 6 1
206 8 10 8 8 4 8 7 7 1 1
207 1 1 1 1 2 1 3 1 1 -1
208 10 10 10 10 7 10 7 10 4 1
209 10 10 10 10 3 10 10 6 1 1
210 8 7 8 7 5 5 5 10 2 1
211 1 1 1 1 2 1 2 1 1 -1
212 1 1 1 1 2 1 3 1 1 -1
213 6 10 7 7 6 4 8 10 2 1
214 6 1 3 1 2 1 3 1 1 -1
215 1 1 1 2 2 1 3 1 1 -1
216 10 6 4 3 10 10 9 10 1 1
217 4 1 1 3 1 5 2 1 1 1
218 7 5 6 3 3 8 7 4 1 1
219 10 5 5 6 3 10 7 9 2 1
220 1 1 1 1 2 1 2 1 1 -1
221 10 5 7 4 4 10 8 9 1 1
222 8 9 9 5 3 5 7 7 1 1
223 1 1 1 1 1 1 3 1 1 -1
224 10 10 10 3 10 10 9 10 1 1
225 7 4 7 4 3 7 7 6 1 1
226 6 8 7 5 6 8 8 9 2 1
227 8 4 6 3 3 1 4 3 1 -1
228 10 4 5 5 5 10 4 1 1 1
229 10 8 8 2 8 10 4 8 10 1
230 9 8 8 5 6 2 4 10 4 1
231 8 10 10 8 6 9 3 10 10 1
232 10 4 3 2 3 10 5 3 2 1
233 5 1 3 3 2 2 2 3 1 -1
234 3 1 1 3 1 1 3 1 1 -1
235 2 1 1 1 2 1 3 1 1 -1
236 1 1 1 1 2 5 5 1 1 -1
237 1 1 1 1 2 1 3 1 1 -1
238 5 1 1 2 2 2 3 1 1 -1
239 8 10 10 8 5 10 7 8 1 1
240 8 4 4 1 2 9 3 3 1 1
241 4 1 1 1 2 1 3 6 1 -1
242 1 2 2 1 2 1 1 1 1 -1
243 10 4 4 10 2 10 5 3 3 1
244 6 3 3 5 3 10 3 5 3 -1
245 6 10 10 2 8 10 7 3 3 1
246 9 10 10 1 10 8 3 3 1 1
247 5 6 6 2 4 10 3 6 1 1
248 3 1 1 1 2 1 1 1 1 -1
249 3 1 1 1 2 1 2 1 1 -1
250 3 1 1 1 2 1 3 1 1 -1
251 5 7 7 1 5 8 3 4 1 -1
252 10 5 8 10 3 10 5 1 3 1
253 5 10 10 6 10 10 10 6 5 1
254 8 8 9 4 5 10 7 8 1 1
255 10 4 4 10 6 10 5 5 1 1
256 7 9 4 10 10 3 5 3 3 1
257 5 1 4 1 2 1 3 2 1 -1
258 10 10 6 3 3 10 4 3 2 1
259 3 3 5 2 3 10 7 1 1 1
260 10 8 8 2 3 4 8 7 8 1
261 1 1 1 1 2 1 3 1 1 -1
262 8 4 7 1 3 10 3 9 2 1
263 5 1 1 1 2 1 3 1 1 -1
264 3 3 5 2 3 10 7 1 1 1
265 7 2 4 1 3 4 3 3 1 1
266 1 1 1 1 2 1 2 1 1 -1
267 1 1 1 1 2 1 3 1 1 -1
268 10 5 7 3 3 7 3 3 8 1
269 3 1 1 1 2 1 3 1 1 -1
270 2 1 1 2 2 1 3 1 1 -1
271 1 4 3 10 4 10 5 6 1 1
272 10 4 6 1 2 10 5 3 1 1
273 7 4 5 10 2 10 3 8 2 1
274 8 10 10 10 8 10 10 7 3 1
275 10 10 10 10 10 10 4 10 10 1
276 3 1 1 1 3 1 2 1 1 -1
277 6 1 3 1 4 5 5 10 1 1
278 5 6 6 8 6 10 4 10 4 1
279 1 1 1 1 2 1 1 1 1 -1
280 1 1 1 1 2 1 3 1 1 -1
281 5 5 7 8 6 10 7 4 1 1
282 5 3 4 3 4 5 4 7 1 -1
283 8 2 1 1 5 1 1 1 1 -1
284 9 1 2 6 4 10 7 7 2 1
285 8 4 10 5 4 4 7 10 1 1
286 1 1 1 1 2 1 3 1 1 -1
287 10 10 10 7 9 10 7 10 10 1
288 1 1 1 1 2 1 3 1 1 -1
289 8 3 4 9 3 10 3 3 1 1
290 10 8 4 4 4 10 3 10 4 1
291 1 1 1 1 2 1 3 1 1 -1
292 1 1 1 1 2 1 3 1 1 -1
293 7 8 7 6 4 3 8 8 4 1
294 3 1 1 1 2 5 5 1 1 -1
295 2 1 1 1 3 1 2 1 1 -1
296 1 1 1 1 2 1 1 1 1 -1
297 8 6 4 10 10 1 3 5 1 1
298 1 1 1 1 2 1 1 1 1 -1
299 1 1 1 1 1 1 2 1 1 -1
300 5 5 5 2 5 10 4 3 1 1
301 6 8 7 8 6 8 8 9 1 1
302 1 1 1 1 5 1 3 1 1 -1
303 4 4 4 4 6 5 7 3 1 -1
304 7 6 3 2 5 10 7 4 6 1
305 3 1 1 1 2 1 3 1 1 -1
306 5 4 6 10 2 10 4 1 1 1
307 1 1 1 1 2 1 3 1 1 -1
308 3 2 2 1 2 1 2 3 1 -1
309 10 1 1 1 2 10 5 4 1 1
310 1 1 1 1 2 1 2 1 1 -1
311 8 10 3 2 6 4 3 10 1 1
312 10 4 6 4 5 10 7 1 1 1
313 10 4 7 2 2 8 6 1 1 1
314 5 1 1 1 2 1 3 1 2 -1
315 5 2 2 2 2 1 2 2 1 -1
316 5 4 6 6 4 10 4 3 1 1
317 8 6 7 3 3 10 3 4 2 1
318 1 1 1 1 2 1 1 1 1 -1
319 6 5 5 8 4 10 3 4 1 1
320 1 1 1 1 2 1 3 1 1 -1
321 1 1 1 1 1 1 2 1 1 -1
322 8 5 5 5 2 10 4 3 1 1
323 10 3 3 1 2 10 7 6 1 1
324 1 1 1 1 2 1 3 1 1 -1
325 2 1 1 1 2 1 1 1 1 -1
326 1 1 1 1 2 1 1 1 1 -1
327 7 6 4 8 10 10 9 5 3 1
328 1 1 1 1 2 1 1 1 1 -1
329 5 2 2 2 3 1 1 3 1 -1
330 1 1 1 1 1 1 1 3 1 -1
331 3 4 4 10 5 1 3 3 1 1
332 4 2 3 5 3 8 7 6 1 1
333 5 1 1 3 2 1 1 1 1 -1
334 2 1 1 1 2 1 3 1 1 -1
335 3 4 5 3 7 3 4 6 1 -1
336 2 7 10 10 7 10 4 9 4 1
337 1 1 1 1 2 1 2 1 1 -1
338 4 1 1 1 3 1 2 2 1 -1
339 5 3 3 1 3 3 3 3 3 1
340 8 10 10 7 10 10 7 3 8 1
341 8 10 5 3 8 4 4 10 3 1
342 10 3 5 4 3 7 3 5 3 1
343 6 10 10 10 10 10 8 10 10 1
344 3 10 3 10 6 10 5 1 4 1
345 3 2 2 1 4 3 2 1 1 -1
346 4 4 4 2 2 3 2 1 1 -1
347 2 1 1 1 2 1 3 1 1 -1
348 2 1 1 1 2 1 2 1 1 -1
349 6 10 10 10 8 10 7 10 7 1
350 5 8 8 10 5 10 8 10 3 1
351 1 1 3 1 2 1 1 1 1 -1
352 1 1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397 3 3 2 6 3 3 3 5 1 -1
398 8 7 8 5 10 10 7 2 1 1
399 1 1 1 1 2 1 2 1 1 -1
400 5 2 2 2 2 2 3 2 2 -1
401 2 3 1 1 5 1 1 1 1 -1
402 3 2 2 3 2 3 3 1 1 -1
403 10 10 10 7 10 10 8 2 1 1
404 4 3 3 1 2 1 3 3 1 -1
405 5 1 3 1 2 1 2 1 1 -1
406 3 1 1 1 2 1 1 1 1 -1
407 9 10 10 10 10 10 10 10 1 1
408 5 3 6 1 2 1 1 1 1 -1
409 8 7 8 2 4 2 5 10 1 1
410 1 1 1 1 2 1 2 1 1 -1
411 2 1 1 1 2 1 2 1 1 -1
412 1 3 1 1 2 1 2 2 1 -1
413 5 1 1 3 4 1 3 2 1 -1
414 5 1 1 1 2 1 2 2 1 -1
415 3 2 2 3 2 1 1 1 1 -1
416 6 9 7 5 5 8 4 2 1 -1
417 10 8 10 1 3 10 5 1 1 1
418 10 10 10 1 6 1 2 8 1 1
419 4 1 1 1 2 1 1 1 1 -1
420 4 1 3 3 2 1 1 1 1 -1
421 5 1 1 1 2 1 1 1 1 -1
422 10 4 3 10 4 10 10 1 1 1
423 5 2 2 4 2 4 1 1 1 -1
424 1 1 1 3 2 3 1 1 1 -1
425 1 1 1 1 2 2 1 1 1 -1
426 5 1 1 6 3 1 2 1 1 -1
427 2 1 1 1 2 1 1 1 1 -1
428 1 1 1 1 2 1 1 1 1 -1
429 5 1 1 1 2 1 1 1 1 -1
430 1 1 1 1 1 1 1 1 1 -1
431 5 7 9 8 6 10 8 10 1 1
432 4 1 1 3 1 1 2 1 1 -1
433 5 1 1 1 2 1 1 1 1 -1
434 3 1 1 3 2 1 1 1 1 -1
435 4 5 5 8 6 10 10 7 1 1
436 2 3 1 1 3 1 1 1 1 -1
437 10 2 2 1 2 6 1 1 2 1
438 10 6 5 8 5 10 8 6 1 1
439 8 8 9 6 6 3 10 10 1 1
440 5 1 2 1 2 1 1 1 1 -1
441 5 1 3 1 2 1 1 1 1 -1
442 5 1 1 3 2 1 1 1 1 -1
443 3 1 1 1 2 5 1 1 1 -1
444 6 1 1 3 2 1 1 1 1 -1
445 4 1 1 1 2 1 1 2 1 -1
446 4 1 1 1 2 1 1 1 1 -1
447 10 9 8 7 6 4 7 10 3 1
448 10 6 6 2 4 10 9 7 1 1
449 6 6 6 5 4 10 7 6 2 1
450 4 1 1 1 2 1 1 1 1 -1
451 1 1 2 1 2 1 2 1 1 -1
452 3 1 1 1 1 1 2 1 1 -1
453 6 1 1 3 2 1 1 1 1 -1
454 6 1 1 1 1 1 1 1 1 -1
455 4 1 1 1 2 1 1 1 1 -1
456 5 1 1 1 2 1 1 1 1 -1
457 3 1 1 1 2 1 1 1 1 -1
458 4 1 2 1 2 1 1 1 1 -1
459 4 1 1 1 2 1 1 1 1 -1
460 5 2 1 1 2 1 1 1 1 -1
461 4 8 7 10 4 10 7 5 1 1
462 5 1 1 1 1 1 1 1 1 -1
463 5 3 2 4 2 1 1 1 1 -1
464 9 10 10 10 10 5 10 10 10 1
465 8 7 8 5 5 10 9 10 1 1
466 5 1 2 1 2 1 1 1 1 -1
467 1 1 1 3 1 3 1 1 1 -1
468 3 1 1 1 1 1 2 1 1 -1