class TestThread extends Thread {
    String id;
    
    public TestThread(String s) {
        id = s;
    }
    
    public float doCalc(int i) {
      float x=0;
      for (int j=0; j<1000000; j++)
        x = j*j-j;
      return x;
    }
    
    public void run() {
        int i;
        float y;
        for (i = 0; i < 100; i++) {
            y=doCalc(i);
            System.out.println(id);
        }
    }
}

public class Test {
    public static void main(String args[]) {
        CPUScheduler c = new CPUScheduler(100);
        TestThread t1, t2, t3;
        t1 = new TestThread("Thread 1");
        t2 = new TestThread("Thread 2");
        t3 = new TestThread("Thread 3");
        c.addThread(t1);
        c.addThread(t2);
        c.addThread(t3);
        c.start();
        t1.start();
        t2.start();
        t3.start();
    }
}
