Page Title Dependant On Input?

Your best bet may be to use existing WordPress filters to modify your page title. For your needs, the the_title() filter would probably be your best best.

Here’s a link to a pretty good tutorial on using it.