include cstdio include cstdlib include cmath include list include iost

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <list>
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <deque>
#include <map>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define forr(i,a,b) for (int i=a; i<=b; i++)
#define ford(i,a,b) for (int i=a; i>=b; i--)
#define mset(a,b) memset(a,b,sizeof(a))
#define sz size()
#define all(A) A.begin(),A.end()
#define sqr(q) q*q
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define X first
#define Y second
typedef long long i64;
typedef vector<int> VI;
typedef vector< VI > VVI;
typedef pair<int,int> PII;
typedef vector<string> VS;
int main()
{
int g[140];
g[1]=1;
g[0]=0;
forr(i,2,100)
g[i]=g[i-1]+g[i-2]+1;
int tc;
scanf("%d",&tc);
int ans[120];
while (tc--)
{
int n;
scanf("%d",&n);
mset(ans,0);
while (n)
{
int j=0;
while (g[j]<n) j++;
ans[j]=1;
n-=g[j-1]+1;
}
int t=100;
while (!ans[t]) t--;
ford(i,t,1) printf("%d",ans[i]);
printf("\n");
}
return 0;
}