Cod sursa(job #2508284)

Utilizator stelian2000Stelian Chichirim stelian2000 Data 11 decembrie 2019 20:55:06
Problema Problema Damelor Scor 100
Compilator py Status done
Runda Arhiva educationala Marime 0.4 kb
nrsol = [2, 10, 4, 40, 92, 352, 724, 2680, 14200, 73712];
ans = ["2 4 1 3", "1 3 5 2 4", "2 4 6 1 3 5", "1 3 5 7 2 4 6", "1 5 8 6 3 7 2 4", "1 3 6 8 2 4 9 7 5", "1 3 6 8 10 5 9 2 4 7", "1 3 5 7 9 11 2 4 6 8 10", "1 3 5 8 10 12 6 11 2 7 9 4", "1 3 5 2 9 12 10 13 4 6 8 11 7"];
f = open("damesah.in", "r");
g = open("damesah.out", "w");
n = int(f.read());
g.write(ans[n-4]+"\n"+str(nrsol[n-4])+"\n");