All submissions for this problem are available.
A father can have 0,1,or 2 sons. Suppose the input is ABC B-D , it means A has two sons B and C and in turn B has one son D. They are invited at a party. They sit acc. to their ages as eldest first then the sons of eldest and then the sons of second person sitting and so on. If a person has no sons then we leave the spaces . In the above example, the sequence of their sitting is ABC-D. It means that B has only one son and in the output we have to find the place where A would be sitting.
HB- BA- ADE
XW- WJB BCA
D-G G-H H-C C-A A-X X-Z
X-Z A-X C-A H-C G-H D-G
Input: etc. Output: etc.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, COB, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, kotlin, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.5, RUBY, rust, SCALA, SCM chicken, SCM guile, SCM qobi, ST, swift, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.