-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path110C.cpp
43 lines (30 loc) · 829 Bytes
/
110C.cpp
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
/*
~ Author : @tridib_2003
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define PI 3.1415926535897932384626
#define MOD 1000000007
#define vi vector<int>
#define mk(arr, n, type) type *arr = new type[n];
#define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++)
#define w(x) int x; cin >> x; while(x--)
#define FIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int main() {
FIO;
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
int rem = n - (i * 4);
if (rem % 7 == 0 && rem >= 0) {
for (int j = 0; j < i; ++j)
cout << 4;
for (int j = 0; j < rem / 7; ++j)
cout << 7;
return 0;
}
}
cout << -1;
return 0;
}