Perhaps it could be useful in this case to specify "long things", to make it clear you're talking about single pencils, and avoid confusion with boxes of pencils.
If there's a specific counter for something, but you dont know it, you can use "개" for general things. There's a lot of counters. I've heard some Koreans don't even know them all.
Who would win?
1 child with 30 Pencils
30 children with one pencil
Don't remember it lol just hear it a few times and let it make sense in your brain. All these subject and object counts have a logical structure in Korean so you just need to be one with the grammar. Apart from the counters this sentence really just has a simple subject-object-verb structure which I'm sure is nothing new at this point. Practice coming up with and speaking new similar sentences instead, that'll hammer the essential skills.