Advertisement
pin2paul

Untitled

Jun 20th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. Its 2050!!
  2. Now-a-days we don't need to waste extra money for household works by keeping housemaid.
  3. Today a Robot has taken the place of a housemaid. A robot can cook, can sweep the floor and so many things that you can't imagine.
  4. For this reason now-a-days people are becoming interested in Robots. There are so many companys who provide these type of Robots.
  5. We will talk about a well known company "AUTO-BOT" that provide these type of Robots.This company was founded
  6. by three friends Pintu,Avik and Atik in 2020. They were graduated from Comilla University from the Department of ICT.
  7.  
  8. The company makes Robots of different features. They named their Robots with integer numbers. Each Robot has a unique name.
  9. And no two different featured Robot has same name.They have enough Robots with same feature and of course their names are same.
  10. But they display only one Robot with same feature in their store. As I told before people are interested in Robots, they have come to the store to buy Robots.
  11. The company has some rules. They allow only one buyer at a time to their store. A buyer can buy only one Robot. Their
  12. Robots are arranged in a line according to their name. The buyer has to search his Robot. A buyer searches his required Robot Linearly.
  13. As soon as he finds it,he buys it and returns home with his Robot.
  14. After a Robot is sold the salesman fulfils the place with another Robot with same feature.
  15. Now you are asked to find the position where the buyer found his Robot.
  16.  
  17. Input:
  18.  
  19. Input starts with an integer T(<=10), denoting the number of test cases.
  20. Each case starts with two integers N ( 1 <= 10^5 ) & M (1 <= 1000) where N denotes number of Robots and M denotes number of buyers.
  21. The next line contains N space seperated integers in Non-decreasing order which are the Robot's name in the range [0,10^9].
  22. Each of the next M lines contain one integer which denoes the buyer's required Robot name.
  23.  
  24. Output:
  25.  
  26. For each test case print the case number in a single line. Then for each buyer print the position where he will find his required Robot
  27. and if not print "Not found" without the quote. See the sample input output for further clarification.
  28.  
  29. Sample Input:
  30.  
  31. 1
  32. 5 3
  33. 1 2 3 4 5
  34. 5
  35. 7
  36. 3
  37.  
  38. Sample Output:
  39.  
  40. Case 1:
  41. 5
  42. Not found
  43. 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement