PHILADELPHIA The students filed into South Philadelphia's Academy at Palumbo auditorium by the dozen Tuesday afternoon, thinking they were in trouble.

Minutes later, the room went dark and balloons started streaming down from the second-floor balcony. As a video began playing on a screen in front of them, the auditorium erupted into a sea of cheers.

Palumbo students learned Tuesday that they had been chosen as one of five winners of Samsung's nationwide Solve for Tomorrow contest, a competition designed to raise awareness for science, technology, engineering, and math education among public school students.

The team, made up of about 15 students and two teachers, used South Philadelphia crime data to create an algorithm mapping out the safest walking route from one location to another.

"A lot of our students come to school from all over the city, and there's been a lot of crime in the area," said Susan Lee, a math teacher at Palumbo, at 1100 Catharine St. "This project had a lot of practical value."

The algorithm assigns blocks around Palumbo a value from one to five. Numbers are based on the history of crime in the area. A street that has seen a recent shooting, for example, would be assigned a 5, while a street that has seen no recent reported incidents would be assigned a 1. The lower the value, the safer the street.

For a school that has been ravaged by budget cuts to the Philadelphia School District, the prize - which includes $140,000 in new technology from Samsung and a free trip to Washington for some of the students and teachers - comes as a piece of much-needed good news.

Over the summer, about 30 of Palumbo's laptops were stolen.

"Seeing a lot of what we once had go away is very depressing," said Steven Geiger, a 17-year-old senior who was a member of the team that developed the algorithm. "It feels good to leave something behind for students who are coming after us."

Lee, along with physics teacher Klint Kanopka and several students, traveled to Austin, Texas, several weeks ago to present the algorithm to a panel of judges at SXSWedu, a national conference on education innovation

The five grand prize winners were chosen from an initial pool of more than 2,300 schools across the country.

"We're representing Philadelphia, we're representing Pennsylvania, we're representing the entire country," said Tarzan MacMood, a 15-year-old sophomore at Palumbo. "It feels really good."