<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>mtock's Feed - Programmer's Heaven</title>
    <link>http://www.programmersheaven.com/feed/User/341241/RSS.aspx</link>
    <description>Events at Programmer's Heaven related to the user mtock.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 19:41:11 -0700</pubDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <item>
      <title>I am trying to write a program for selecting students:</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/392921/392921/ReadMessage.aspx#392921</link>
      <description>&lt;p&gt;Posted a '&lt;a href="http://www.programmersheaven.com/mb/Algorithms/392921/392921/ReadMessage.aspx#392921"&gt;new message&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/Algorithms/Board.aspx"&gt;Algorithms&lt;/a&gt; forum.&lt;/p&gt;The competition is open to kids who are in schools in our county. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
For the purposes of the exercise, let’s say there are two teams from each school that compete.  One team is the Math team, and one team is the Physics team.  &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Each team consists of 3 students.  &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The rules say that only 4 students from each grade are allowed to attend, because the building where the competition takes place is very small.  &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
This means that even though there are two teams of 3 students each, some students will have to be on both teams.  &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
The children of the coaches are automatically given a position on the team they are coaching. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
Now, let’s say 6 kids sign up to go to the competition.  The school has to figure out how to select 4 of these 6 kids to compete. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
We have two coaches, so we know their kids each have a spot.  That leaves 4 team positions open.  But since each school is limited to only sending 4 kids total, we can only choose 2 other kids to fill in the remaining spots.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What method do you use to choose the additional 2 kids? &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
In general, we want to solve the problem of having n teams with 3 members each, with a limit of x kids per school.  In the example above, n = 2 and x = 4. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
I hope that makes sense.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the actual competition I’m trying to help with, there are 36 available team positions, but only 20 kids per school are allowed to attend the competition.  So if we have 36 kids sign up for 2nd grade, we have to cut 16 of them.  (The kids whose parent are coaches won’t be cut.)&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/392921/392921/ReadMessage.aspx#392921</guid>
      <pubDate>Fri, 26 Jun 2009 16:17:58 -0700</pubDate>
    </item>
  </channel>
</rss>