6. BRACU has n students who are regular competitive programmers. According to the ACM ICPC rules, each person can participate in the regional championship at most 5 times. The head of the BRACU ACM Chapter is recently gathering teams to participate in this championship. Each team must consist of exactly three people, at that, any person cannot be a member of two or more teams. What maximum number of teams can the head make if he wants each team to participate in the world championship with the same members at least k times? The first line of input contains two integers, n and k. The next line contains n integers: y1.y2...yn (O£yi£5), where yi shows the number of times the ih person participated in the ACM ICPC Regional. Write a python program that prints how many teams can be formed according to the above problem statement. Sample Input 1 52 04510 Sample Input 2 Sample Output 1 1 64 012345 Sample Output 2 Sample Input 3 65 Sample Output 3 000000 2

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter20: Queuing Theory
Section: Chapter Questions
Problem 17RP
icon
Related questions
Question

python Question.

6.
BRACU has n students who are regular competitive programmers. According
to the ACM ICPC rules, each person can participate in the regional championship
at most 5 times.
The head of the BRACU ACM Chapter is recently gathering teams to participate
in this championship. Each team must consist of exactly three people, at that, any
person cannot be a member of two or more teams. What maximum number of teams
can the head make if he wants each team to participate in the world championship
with the same members at least k times?
The first line of input contains two integers, n and k. The next line contains n
integers: y1.y2..yn (0£yi<5), where yi shows the number of times the ihperson
participated in the ACM ICPC Regional.
Write a python program that prints how many teams can be formed according to
the above problem statement.
Sample Input 1
52
0 4510
Sample Input 2
Sample Output 1
1
6 4
0123 45
Sample Output 2
Sample Input 3
65
Sample Output 3
0 00000
2
Transcribed Image Text:6. BRACU has n students who are regular competitive programmers. According to the ACM ICPC rules, each person can participate in the regional championship at most 5 times. The head of the BRACU ACM Chapter is recently gathering teams to participate in this championship. Each team must consist of exactly three people, at that, any person cannot be a member of two or more teams. What maximum number of teams can the head make if he wants each team to participate in the world championship with the same members at least k times? The first line of input contains two integers, n and k. The next line contains n integers: y1.y2..yn (0£yi<5), where yi shows the number of times the ihperson participated in the ACM ICPC Regional. Write a python program that prints how many teams can be formed according to the above problem statement. Sample Input 1 52 0 4510 Sample Input 2 Sample Output 1 1 6 4 0123 45 Sample Output 2 Sample Input 3 65 Sample Output 3 0 00000 2
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
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
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr