int nThreads = Integer.parseInt(args[0]);
long n = Long.parseLong(args[1]);
Thread t[] = new Thread[nThreads];
for (int i = 0; i < t.length; i++) {
t[i] = new Thread(new Task(n, "Task " + i));
t[i].start();
}
for (int i = 0; i < t.length; i++) {
try {
t[i].join();
} catch (InterruptedException ie) {}
}