How to take input in problem ANARC07G on spoj?

dynamic-programming

#1

How to take input in problem ANARC07G on spoj?
i mean how to store data in such a way that i ca n find out who is having how many children and their names.
I am using C++ language.


#2

please answer.