This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Daily_Programmer

By: a guest on Jan 16th, 2013  |  syntax: None  |  size: 0.67 KB  |  views: 459  |  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. ========= EXAMPLE 1 ========
  2. INPUT:
  3. 2
  4. S.
  5. E.
  6. OUTPUT:
  7. True, 1
  8.  
  9. ========= EXAMPLE 2 ========
  10. INPUT:
  11. 4
  12. ...S
  13. ....
  14. ....
  15. ...E
  16. OUTPUT:
  17. True, 3
  18.  
  19. ========= EXAMPLE 3 ========
  20. INPUT:
  21. 4
  22. S...
  23. ....
  24. ....
  25. ...E
  26. OUTPUT:
  27. True, 6
  28.  
  29. ========= EXAMPLE 4 ========
  30. INPUT:
  31. 5
  32. S....
  33. WWWW.
  34. .....
  35. .WWWW
  36. ....E
  37. OUTPUT:
  38. True, 16
  39.  
  40. ========= EXAMPLE 5 ========
  41. INPUT:
  42. 5
  43. ..W.S
  44. ....W
  45. .WWWW
  46. .W...
  47. ...WE
  48. OUTPUT:
  49. True, 14
  50.  
  51. ========= EXAMPLE 6 ========
  52. INPUT:
  53. 5
  54. ..S..
  55. .WWW.
  56. .....
  57. WWW..
  58. ..E..
  59. OUTPUT:
  60. True, 8
  61.  
  62. ========= EXAMPLE 7 ========
  63. INPUT:
  64. 4
  65. ....
  66. ...E
  67. WWW.
  68. .SW.
  69. OUTPUT:
  70. False
  71.  
  72. ========= EXAMPLE 8 ========
  73. INPUT:
  74. 4
  75. SW.E
  76. .W..
  77. .W..
  78. .W..
  79. OUTPUT:
  80. False
clone this paste RAW Paste Data