A couple of years ago, a new world wide crisis started,
leaving many people with economical problems. Some workers of a particular
company are trying to ask for an increase in their salaries.
The company has a strict hierarchy, in which each employee
has exactly one direct boss, with the exception of the owner of the company that
has no boss. Employees that are not bosses of any other employee are called workers.
The rest of the employees and the owner are called bosses.
To ask for a salary increase, a worker should file a
petition to his direct boss. Of course, each boss is encouraged to try to make
their subordinates happy with their current income, making the company's profit
as high as possible. However, when at least T
percent of its direct subordinates have filed a petition, that boss will be
pressured and have no choice but to file a petition himself to his own direct
boss. Each boss files at most 1 petition to his own direct boss, regardless on
how many of his subordinates filed him a petition. A boss only accounts his
direct subordinates (the ones that filed him a petition and the ones that
didn't) to calculate the pressure percentage.
Note that a boss can have both workers and bosses as
direct subordinates at the same time. Such a boss may receive petitions from
both kinds of employees, and each direct subordinate, regardless of its kind,
will be accounted as 1 when checking the pressure percentage.
When a petition file gets all the way up to the owner of
the company, all salaries are increased. The workers' union is desperately
trying to make that happen, so they need to convince many workers to file a
petition to their direct boss.
Given the company's hierarchy and the parameter T,
you have to find out the minimum number of workers that have to file a petition
in order to make the owner receive a petition.