Pagini recente » Cod sursa (job #1477699) | Cod sursa (job #2110996) | Cod sursa (job #2240274) | Cod sursa (job #1829533) | Cod sursa (job #2966411)
#include <bits/stdc++.h>
using namespace std;
ifstream in("f.in");
ofstream out("f.out");
int n;
int main()
{
int t;
in >> t;
in >> n;
int puteri = {16,32,64,128,256,512,1024};
if(t == 1)
{
if(n == 2)
{
out << 2 << ' ' << 2;
}
else if(n == 3)
{
out << 4 << ' ' << 4 << ' ' << 2;
}
else if(n == 4)
{
out << 4 << ' ' << 4 << ' ' << 4 << ' ' << 4;
}
else if(n == 5)
{
out << 4 << ' ' << 4 << ' ' << 4 << ' ' << 8 << ' ' << 8;
}
else
{
vector <int> v;
v.push_back(4);
v.push_back(4);
v.push_back(4);
v.push_back(8);
out << 4 << ' ' << 4 << ' ' << 4 << ' ' << 8 << ' ';
int maxput = pow(2, n - 2);
int poz = 0;
for(int i = 1; i <= 7; i++)
{
if(puteri[i] == maxput)
{
poz = i;
}
}
for(int i = 1; i <= poz - 1; i++)
out << puteri[i] << ' ';
out << puteri[poz] << ' ' << puteri[poz];
}
}
return 0;
}