Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream fin("chibrituri.in")
- ofstream fout("chibrituri.out")
- int main()
- {
- int k=0,vert,oriz,SV,SO,xmin,xmax,h,m,hu,hz,mu,mz,i,v[10],o[10];
- v[]={4,2,2,2,3,2,3,2,4,3};
- o[]={2,0,3,3,1,3,3,1,3,3};
- fin>>vert>>oriz;
- xmin=1439;
- xmax=0;
- for (x=0;x<=1439;x++)
- {
- hu=x/60/10;
- hz=x/60%10;
- mu=x%60%10;
- mz=x%60/10;
- SV=v[hu]+v[hz]+v[mu]+v[mz];
- SO=o[hu]+o[hz]+o[mu]+o[mz];
- if (SV==vert && SO==oriz)
- {
- k++;
- if (x<xmin)
- xmin=x;
- if (x>xmax)
- xmax=x;
- }
- }
- fout<<k<<'\n';
- fout<<xmin/60/10<<xmin/60%10<<":"<<xmin%60/10<<xmin%60%10<<'\n';
- fout<<xmax/60/10<<xmax/60%10<<":"<<xmax%60/10<<xmax%60%10<<'\n';
- fin.close();
- fout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement