Skip to content

Commit

Permalink
Fix up internet-connection problem
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Mar 20, 2024
1 parent f0eb2db commit 9876aa8
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"readme": "./problems/crafting/README.md"
},
{
"cmd": "false",
"readme": "./problems/_placeholder/README.md"
"cmd": "python3 -m problems.internet-connection",
"readme": "./problems/internet-connection/README.md"
},
{
"cmd": "false",
Expand Down
102 changes: 51 additions & 51 deletions problems/internet-connection/README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
# Internet Connection

March madness has started and everything is going perfectly as planned! Well, minus
some issues with the coding questions... Because you're such an amazing
organizer and the lovely people at ACM offer so much support, the event is far
more popular than anyone could have imagined.

It's nearly time to host the Hackathon, and you're beginning to realize that
it's almost impossible to pack everyone into the Computer Science building for
this event. The concern now becomes, where can we put students on campus so
that they still have access to a strong Internet connection throughout the
Hackathon?

Thankfully, you managed to get a list of all the locations of available routers
on campus, as well as how far they can reach. The list of all routers may look
something like the following:

```
Router located at x=4, y=7 with reach=3ft
Router located at x=6, y=4 with reach=4ft
Router located at x=10, y=10 with reach=3ft
```

Imagining the campus as a grid on a Cartesian (2D) plane, we can picture where
the routers are. Unfortunately for us, the school cheaped out when buying
routers, so they opted for a large quantity of routers with bad service, but
long range.

A single router is not enough for a student to maintain a stable connection. To
combat this while remaining cost-effective, the school has implemented a system
where two routers can help boost each other's signals and offer a student a
stable connection!

If a student is within range of two different routers at once, their connection
will be more than enough to sustain any activities they may try. Our goal is to
ensure that every student has a stable connection for this Hackathon, so we
will only look for areas that are in the range of 2 different routers to try
and place them there.

## Part 1

Given the long list of routers, **how many pairs of routers offer an area of
any size where a student can maintain a stable connection?**

## Part 2

To avoid scattering students all over campus in search of a good Internet
connection, we have to optimize our space. We have all the spaces where
students have a good Internet connection now, and we just need to figure out
where the students should go. **What is the largest area of overlap that any
pair of routers creates?**
# Internet Connection

March madness has started and everything is going perfectly as planned! Well, minus
some issues with the coding questions... Because you're such an amazing
organizer and the lovely people at ACM offer so much support, the event is far
more popular than anyone could have imagined.

It's nearly time to host the Hackathon, and you're beginning to realize that
it's almost impossible to pack everyone into the Computer Science building for
this event. The concern now becomes, where can we put students on campus so
that they still have access to a strong Internet connection throughout the
Hackathon?

Thankfully, you managed to get a list of all the locations of available routers
on campus, as well as how far they can reach. The list of all routers may look
something like the following:

```
Router located at x=4, y=7 with reach=3ft
Router located at x=6, y=4 with reach=4ft
Router located at x=10, y=10 with reach=3ft
```

Imagining the campus as a grid on a Cartesian (2D) plane, we can picture where
the routers are. Unfortunately for us, the school cheaped out when buying
routers, so they opted for a large quantity of routers with bad service, but
long range.

A single router is not enough for a student to maintain a stable connection. To
combat this while remaining cost-effective, the school has implemented a system
where two routers can help boost each other's signals and offer a student a
stable connection!

If a student is within range of two different routers at once, their connection
will be more than enough to sustain any activities they may try. Our goal is to
ensure that every student has a stable connection for this Hackathon, so we
will only look for areas that are in the range of 2 different routers to try
and place them there.

## Part 1

Given the long list of routers, **how many pairs of routers offer an area of
any size where a student can maintain a stable connection?**

## Part 2

To avoid scattering students all over campus in search of a good Internet
connection, we have to optimize our space. We have all the spaces where
students have a good Internet connection now, and we just need to figure out
where the students should go. **What is the largest area of overlap that any
pair of routers creates?**

0 comments on commit 9876aa8

Please sign in to comment.