public class Exercice5 {
  
  static class Duree {
   int mn;
   int s; }

  static Duree [] generationTableauDuree(int n) {
    Duree [] td = new Duree[n];
    for ( int i = 0 ; i < td.length ; i++ ) {
      td[i] = new Duree();
    }
    for ( int i = 0 ; i < td.length ; i++ ) {
      td[i].mn =(int) (Math.random()*11);
      td[i].s =(int) (Math.random()*60);
    }
    return td;
  }
   
  static Duree dureeTotale(Duree [] t) {
    Duree d = new Duree();
    for ( int i = 0 ; i < t.length ; i++ ) {
      d.mn += t[i].mn;
      d.s += t[i].s;
    }
    d.mn += d.s/60;
    d.s %= 60;
    return d;
  }
  
  public static void main(String [] args) {
    Duree [] tt = generationTableauDuree(40);
    for ( int i = 0 ; i < tt.length ; i++ ) {
      Ecran.afficherln(tt[i].mn," ",tt[i].s);
    }
    Duree tot = dureeTotale(tt);
    Ecran.afficherln(tot.mn," ",tot.s);
  }
}