Actually, there is. And it's quite simple, really:
"Thanks very much for your time, but I've gone through many, many rounds of questions like these, and have come to the conclusion that, while interesting and to some extent topically relevant, ultimately the ability to regurgitate answers to them on the spot has extremely low relevance to the work that one actually does as an engineer. And BTW I noticed your statement of the problem was not only very muddled, but English-wise, barely readable. And actually, as presented, the problem isn't actually tractable, math-wise. And like, you brought me in here to solve the knapsack problem on a quadrillion integers in 2K of space or whatever and yet, you couldn't even think to stock the whiteboard with fresh markers? Or clean it first, for heaven's sake? Really, what's up with that? And gee, isn't the vibe in here, like, really really starting to suck now, given that at one of the interviewers is starting to fumble with his phone already, indicating that he would clearly very greatly prefer to be somewhere else, doing just about anything else - like you know, actually productive - than what you've forced the poor sap to do for you right now?
"But we don't need to dwell on that. The point is that we have different perspectives on these things, which is of course perfectly fine. So if you don't mind, howabout we part ways and do something else with the rest of our respective afternoons?"
You have to do them.
Beyond tending to basic needs (shelter, clothing, food, etc) you don't "have to" do anything.
You may not get to work for those companies (and it is a great many, unfortunately) that have bought into the whiteboarding cult. And that may seem to kind of suck. But it's not like you "have to" work for those companies (as much as they would dearly, dearly like for you to implicitly and unquestioningly believe exactly that).