Acid and Base
Time limit1sMemory limit256 MB
Compute the pH from each given H+ or OH- concentration with the log formulas and print it rounded to two decimals.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
The pH of a solution measures how water ionizes to form (acids) or (bases).
There are four variables (, , , and ) and two equations:
They are also related by .
Input
The first line contains the number of data sets. Each data set is either an concentration written as H = ... or an concentration written as OH = ....
Output
For each data set, print the pH rounded to the nearest hundredth.