Skip to content

Commit

Permalink
Update BirthdayParty.txt
Browse files Browse the repository at this point in the history
Wrap lines for easier reading in GitHub's Code Viewer
  • Loading branch information
JayWelborn authored Oct 17, 2018
1 parent f84e0f1 commit 4ccfa83
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ASSIGNMENTS/BirthdayParty.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
Chef has invited his friends on his birthday party. There are total N friends that are coming at his home. You are given the arriving and leaving time of each friend and Q queries. Each Query consists of an integer t, you have to output the number of friends that are present at time t at Chef's home.
Chef has invited his friends on his birthday party. There are total N friends that are
coming at his home. You are given the arriving and leaving time of each friend and Q
queries. Each Query consists of an integer t, you have to output the number of friends
that are present at time t at Chef's home.

Input
The first line contains T, the number of testcases.

The first line of each testcase contain two space separated integers N and Q, then follow N lines containing two space separated integers ai bi, the arriving and leaving time of ith friend respectively.
The first line of each testcase contain two space separated integers N and Q, then
follow N lines containing two space separated integers ai bi, the arriving and leaving
time of ith friend respectively.

Next Q lines contains a single integer t asking the number of friends at Chef's house present at time t.
Next Q lines contains a single integer t asking the number of friends at Chef's house
present at time t.

Output
For each query, output the required answer in a new line.
Expand All @@ -30,4 +36,4 @@ Input:
Output:
1
3
1
1

0 comments on commit 4ccfa83

Please sign in to comment.