Two snowboarding teenagers who spent a cold night in the backcountry near Nelson, B.C., are safe after being discovered by a search team — and have some school homework to thank for helping to keep them warm.

RCMP say they received a call Sunday night when the teens didn't return from an out-of-bounds area near the Whitewater Ski Resort. A search for the 16-year-old boys was suspended Sunday as the weather worsened.

A helicopter was brought in to help search the backcountry on Monday, when the air crew spotted the pair.

"They're extremely lucky," said Jim Kyle, the manager of Nelson Search and Rescue.

"To tell you the truth, I didn't think the helicopter was going to be able to fly because it was snowing at the time. But the ceiling must've just lifted enough for them to fly into the valley and pick these kids up."

They had managed to build a fire and a shelter for warmth, Kyle said, and stayed put.

"One young person had homework in his backpack and that definitely helped keep the fire going," he said.

"They did all the right things."

Kyle said the teens were found in good spirits but cold, with a bit of frostnip to their hands, which is less serious than frostbite and doesn't cause permanent tissue damage if caught in time.

The pair were taken for a medical assessment and released.