Advertisement
Saleh127

CF 110C

Aug 7th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. ios_base::sync_with_stdio(0);
  6. cin.tie(0);cout.tie(0);
  7. int a,c,d,e,f,i,j=0,k=0,l;
  8. cin>>a;
  9. while(a>0)
  10. {
  11. if(a%7==0)
  12. {
  13. a-=7;
  14. k++;
  15. }
  16. else
  17. {
  18. j++;
  19. a-=4;
  20. }
  21. }
  22. if(a) cout<<-1<<endl;
  23. else
  24. {
  25. for(i=0;i<j;i++)
  26. {
  27. cout<<4;
  28. }
  29. for(i=0;i<k;i++)
  30. {
  31. cout<<7;
  32. }
  33. cout<<endl;
  34. }
  35.  
  36. return 0;
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement