public static void main(String args)
Scanner sc =new Scanner(System.in);
int c = new int[k];
System.out.print(c[i] + " ");
In general it’s better if you share a link to your code (link) and use the question space to describe what your algorithm is. Then everything is in useful places with proper formatting.
Have you considered what happens when all the “reactors” are full and another particle comes in? What should happen is that all reactors become empty, but I don’t see a mechanism for that to happen in your code. This is probably giving your “wrong answer” issue.
8 1 3
0 0 0
As for the “time limit exceeded” problem - that is because you are modeling the process directly. The number of particles in the first reactor follows a simple pattern; once you have this you should be able to see how to make it work for the other reactors also.