Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Its 2050!!
- Now-a-days we don't need to waste extra money for household works by keeping housemaid.
- 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.
- For this reason now-a-days people are becoming interested in Robots. There are so many companys who provide these type of Robots.
- We will talk about a well known company "AUTO-BOT" that provide these type of Robots.This company was founded
- by three friends Pintu,Avik and Atik in 2020. They were graduated from Comilla University from the Department of ICT.
- The company makes Robots of different features. They named their Robots with integer numbers. Each Robot has a unique name.
- And no two different featured Robot has same name.They have enough Robots with same feature and of course their names are same.
- 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.
- The company has some rules. They allow only one buyer at a time to their store. A buyer can buy only one Robot. Their
- Robots are arranged in a line according to their name. The buyer has to search his Robot. A buyer searches his required Robot Linearly.
- As soon as he finds it,he buys it and returns home with his Robot.
- After a Robot is sold the salesman fulfils the place with another Robot with same feature.
- Now you are asked to find the position where the buyer found his Robot.
- Input:
- Input starts with an integer T(<=10), denoting the number of test cases.
- 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.
- The next line contains N space seperated integers in Non-decreasing order which are the Robot's name in the range [0,10^9].
- Each of the next M lines contain one integer which denoes the buyer's required Robot name.
- Output:
- 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
- and if not print "Not found" without the quote. See the sample input output for further clarification.
- Sample Input:
- 1
- 5 3
- 1 2 3 4 5
- 5
- 7
- 3
- Sample Output:
- Case 1:
- 5
- Not found
- 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement