Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 1st, 2012  |  syntax: None  |  size: 0.64 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Tommy reach school frm his home there are many places b/w their home and school connected by bidirectional paths u have to count no of different places he can cover from home to school. condition is one place can't be visited twice and after reaching school he can't proceed further.
  2. you have
  3. given:-
  4. Input
  5. t
  6. n m h s
  7. m lines
  8. Output:
  9. count
  10. t is  number of test case
  11. n is number of nodes,m id number of bidirectional path, h is home and s is school
  12. m lines bidirectional path b/w nodes x and y.
  13. out put count is number of different nodes he can go from school satisfying the condition.
  14. Sample Input:
  15. 1
  16. 3 3 0 1
  17. 0 1
  18. 1 2
  19. 0 2
  20. Sample Output:
  21. 3