It's Like I Have ESPN or something Problem Submissions Discussions Karen Smith is one of those gifted teens with the power of ESPN. For us normal people, this skill is also known as telepathy. She can read the minds of people around her, which helps her out because she loves gossip. She frequently just sits in crowded areas around North Shore High School and uses her ESPN to read the minds of the people around her. After picking up gossip, she goes to her friends Cady, Regina, and Gretchen to tell them all these "fetch" stories. However, the range of her ESPN is limited. Before she starts collecting gossip, she must prepare a certain amount of ESPN energy E before starting to read people's minds. If she accumulates E energy, she can read the minds of the people who are at most E units away from her. Distance between two points (x1, y₁) and (2, 2) is defined as the Manhattan distance D = |x1 - x2| + |y1 - y2| Karen goes to the cafeteria to start collecting gossip. She positions herself at the coordinates (K, Ky) and prepares E energy. Given the positions of the N people in the cafeteria, how many people can Karen collect gossip from? Input Format Input consists of one test case beginning with three space-separated integers N, K₂, and K, which are the number of people in the cafeteria, and Karen's location respectively. N lines follow, the ith of which containing two space-separated integers X; and Y₁ denoting the coordinates of the ith person. The next line contains a single integer Q. You must answer Q queries. The next Q lines contain an integer E, which is the energy of Karen for that query. Constraints 0 ≤N≤ 105 0≤K, K₂, X, Y| ≤ 108 0 ≤E≤ 4.108 1≤Q≤ 105 Output Format For each query, output one line containing a single integer which denotes the number of people within range of Karen's ESPN. Output Format For each query, output one line containing a single integer which denotes the number of people within range of Karen's ESPN. Sample Input 0 367 -10 10 -60 87 3 30 6 1 Sample Output 0 3 0 Explanation 0 The distances of the 3 people are 19, 19, and 2. With E=30, Karen can use ESPN on all 3 of them. With E= 6, she can only reach the one 2 units away. With E= 1, she can't reach any of them with her ESPN. 1 n, kx, ky = list(map(int,input().rstrip().split(" 2 people = [list (map(int,input().rstrip().split(" 3 q= int(input().rstrip()) 4 for cc in range (q): 5 e = int(input()) 6 # solve for ans 7 ans = 8 9 print (ans) "))) "))) for i in range(n)] Pypy 3

Oh no! Our experts couldn't answer your question.

Don't worry! We won't leave you hanging. Plus, we're giving you back one question for the inconvenience.

Submit your question and receive a step-by-step explanation from our experts in as fast as 30 minutes.
You have no more questions left.
Message from our expert:
Our experts are unable to provide you with a solution at this time. Try rewording your question, and make sure to submit one question at a time. We've credited a question to your account.
Your Question:

Need help in solving the problem described in the screenshot in  pyp3 to get the desirable output as mentioned in the screenshot in the most efficient manner

It's Like I Have ESPN or something
Problem
Submissions
Discussions
Karen Smith is one of those gifted teens with the power of ESPN. For us normal people, this skill is also known
as telepathy. She can read the minds of people around her, which helps her out because she loves gossip. She
frequently just sits in crowded areas around North Shore High School and uses her ESPN to read the minds of
the people around her. After picking up gossip, she goes to her friends Cady, Regina, and Gretchen to tell
them all these "fetch" stories.
However, the range of her ESPN is limited. Before she starts collecting gossip, she must prepare a certain
amount of ESPN energy E before starting to read people's minds. If she accumulates E energy, she can read
the minds of the people who are at most E units away from her. Distance between two points (x1, y₁) and
(2, 2) is defined as the Manhattan distance
D = |x1 - x2| + |y1 - y2|
Karen goes to the cafeteria to start collecting gossip. She positions herself at the coordinates (K, Ky) and
prepares E energy. Given the positions of the N people in the cafeteria, how many people can Karen collect
gossip from?
Input Format
Input consists of one test case beginning with three space-separated integers N, K₂, and K, which are the
number of people in the cafeteria, and Karen's location respectively.
N lines follow, the ith of which containing two space-separated integers X; and Y₁ denoting the coordinates
of the ith person.
The next line contains a single integer Q. You must answer Q queries.
The next Q lines contain an integer E, which is the energy of Karen for that query.
Constraints
0 ≤N≤ 105
0≤K, K₂, X, Y| ≤ 108
0 ≤E≤ 4.108
1≤Q≤ 105
Output Format
For each query, output one line containing a single integer which denotes the number of people within range
of Karen's ESPN.
Transcribed Image Text:It's Like I Have ESPN or something Problem Submissions Discussions Karen Smith is one of those gifted teens with the power of ESPN. For us normal people, this skill is also known as telepathy. She can read the minds of people around her, which helps her out because she loves gossip. She frequently just sits in crowded areas around North Shore High School and uses her ESPN to read the minds of the people around her. After picking up gossip, she goes to her friends Cady, Regina, and Gretchen to tell them all these "fetch" stories. However, the range of her ESPN is limited. Before she starts collecting gossip, she must prepare a certain amount of ESPN energy E before starting to read people's minds. If she accumulates E energy, she can read the minds of the people who are at most E units away from her. Distance between two points (x1, y₁) and (2, 2) is defined as the Manhattan distance D = |x1 - x2| + |y1 - y2| Karen goes to the cafeteria to start collecting gossip. She positions herself at the coordinates (K, Ky) and prepares E energy. Given the positions of the N people in the cafeteria, how many people can Karen collect gossip from? Input Format Input consists of one test case beginning with three space-separated integers N, K₂, and K, which are the number of people in the cafeteria, and Karen's location respectively. N lines follow, the ith of which containing two space-separated integers X; and Y₁ denoting the coordinates of the ith person. The next line contains a single integer Q. You must answer Q queries. The next Q lines contain an integer E, which is the energy of Karen for that query. Constraints 0 ≤N≤ 105 0≤K, K₂, X, Y| ≤ 108 0 ≤E≤ 4.108 1≤Q≤ 105 Output Format For each query, output one line containing a single integer which denotes the number of people within range of Karen's ESPN.
Output Format
For each query, output one line containing a single integer which denotes the number of people within range
of Karen's ESPN.
Sample Input 0
367
-10 10
-60
87
3
30
6
1
Sample Output 0
3
0
Explanation 0
The distances of the 3 people are 19, 19, and 2.
With E=30, Karen can use ESPN on all 3 of them.
With E= 6, she can only reach the one 2 units away.
With E= 1, she can't reach any of them with her ESPN.
1
n, kx, ky = list(map(int,input().rstrip().split("
2 people = [list (map(int,input().rstrip().split("
3 q= int(input().rstrip())
4 for cc in range (q):
5
e = int(input())
6
# solve for ans
7
ans =
8
9
print (ans)
")))
"))) for i in range(n)]
Pypy 3
Transcribed Image Text:Output Format For each query, output one line containing a single integer which denotes the number of people within range of Karen's ESPN. Sample Input 0 367 -10 10 -60 87 3 30 6 1 Sample Output 0 3 0 Explanation 0 The distances of the 3 people are 19, 19, and 2. With E=30, Karen can use ESPN on all 3 of them. With E= 6, she can only reach the one 2 units away. With E= 1, she can't reach any of them with her ESPN. 1 n, kx, ky = list(map(int,input().rstrip().split(" 2 people = [list (map(int,input().rstrip().split(" 3 q= int(input().rstrip()) 4 for cc in range (q): 5 e = int(input()) 6 # solve for ans 7 ans = 8 9 print (ans) "))) "))) for i in range(n)] Pypy 3
Knowledge Booster
Business Intelligence Analytics tools and techniques
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning