71 lines
1.7 KiB
C++
71 lines
1.7 KiB
C++
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
typedef long long LL;
|
|
struct Node {
|
|
int number;
|
|
int cnt;
|
|
} a[6] = {{1, 2}, {2, 5}, {4, 4}, {6, 6}, {7, 3}, {8, 7}};
|
|
LL res = LONG_LONG_MAX;
|
|
int main() {
|
|
int m;
|
|
cin >> m;
|
|
for (int n = 1;n<=m;n++){
|
|
cout << n<<"=";
|
|
if (n == 1)
|
|
cout << "-1" << endl;
|
|
else if (n == 2)
|
|
cout << "1" << endl;
|
|
else if (n == 3)
|
|
cout << "7" << endl;
|
|
else if (n == 4)
|
|
cout << "4" << endl;
|
|
else if (n == 5)
|
|
cout << "2" << endl;
|
|
else if (n == 6)
|
|
cout << "6" << endl;
|
|
else if (n == 7)
|
|
cout << "8" << endl;
|
|
else if (n == 17)
|
|
cout << "200" << endl;
|
|
else if (n % 7 == 1) {
|
|
cout << "10";
|
|
for (int i = 1; i < n / 7; i++) cout << "8";
|
|
cout << endl;
|
|
}
|
|
else if(n%7==2){
|
|
cout << "1";
|
|
for (int i = 1; i <= n / 7; i++) cout << "8";
|
|
cout << endl;
|
|
}
|
|
else if(n%7==3){
|
|
if (n == 10) cout << "22";
|
|
else {
|
|
cout << "200";
|
|
for (int i = 1; i <= n / 7-2; i++) cout << "8";
|
|
}
|
|
cout << endl;
|
|
}
|
|
else if(n%7==4){
|
|
cout << "20";
|
|
for (int i = 1;i<n/7;i++)cout<<"8";
|
|
cout<<endl;
|
|
}
|
|
else if(n%7==5){
|
|
cout << "2";
|
|
for (int i = 1; i <= n/7; i++)cout<<"8";
|
|
cout << endl;
|
|
}
|
|
else if(n%7==6){
|
|
cout << "6";
|
|
for (int i = 1; i <= n/7; i++)
|
|
cout<<"8";
|
|
|
|
cout<<endl;}
|
|
else if(n%7==0){
|
|
for (int i = 1; i <= n/7; i++)
|
|
cout<<"8";
|
|
|
|
cout<<endl;}
|
|
}
|
|
return 0;
|
|
} |