Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- long long s[]={6,2,5,5,4,5,5,3,7,6};
- long long n,a,b,c,d,k=0;
- cin>>n;
- if(n<8 && n>26)
- {cout<<"Impossible"<<endl;
- return 0;}
- for(a=0; a<=2; a++){
- for(b=0; b<=9; b++){
- for(c=0; c<=5; c++){
- for(d=0;d<=9;d++){
- if(!(a==2 && b>3))
- {if((s[a]+s[b]+s[c]+s[d])==n){
- k++;
- cout<<a<<b<<":"<<c<<d<<endl;
- return 0;}}}}}}
- cout<<"Impossible"<<endl;
- return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement