fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5. int t,n; cin >> t;
  6. while(t--){
  7. cin >> n;
  8. if(n == 2) cout << "1\n";
  9. else if(n == 3) cout << "7\n";
  10. else{
  11. map<int,int> mp = {{2,1},{3,7},{4,4},{5,5},{6,9},{7,8}};
  12.  
  13. int dcount = n/2;
  14. string ans = "";
  15. for(int i=0;i<dcount-1;++i){
  16. ans = "1" + ans;
  17. n -= 2;
  18. }
  19. cout << mp[n] << ans << endl;
  20. }
  21. }
  22. }
Success #stdin #stdout 0.01s 5284KB
stdin
2
3
4
stdout
7
11