fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int N;
  6. cin>>N;
  7. int a[2][N];
  8. int now[2][1];
  9. for(int n=0;n<N;n++){
  10. cin>>a[0][n]>>a[1][n];
  11. }
  12. for(int n=0;n<N;n++){
  13. cout<<a[0][n]<<" "<<a[1][n]<<endl;
  14. }
  15. cin>>now[0][0]>>now[1][0];
  16. now[1][0]+=20;
  17. if(now[1][0]>=60){
  18. now[1][0]-=60;
  19. now[0][0]+=1;
  20. }
  21. int b=0;
  22. while(b<N){
  23. if( (a[0][b]=now[0][0] && a[1][b]>=now[1][0]) or
  24. a[0][b]>now[0][0]){
  25. cout<<a[0][b]<<" "<<a[1][b];
  26. return 0;
  27. }
  28. else
  29. b++;
  30. }
  31. cout<<"Too Late";
  32. }
Success #stdin #stdout 0s 5304KB
stdin
3
14 50
15 05
16 00
14 30
stdout
14 50
15 5
16 0
1 50