usaco sec1.5 checker
bit manipulation, idea bought from matrix67's blog