Find The Simplest Sum
(I do not intend to address the better algorithm angle beyond stating that this is another hackerrank problem seeking the series for a sequence and quoting one advice: Pen down a few iterations yourself and you will find a way to compute the function value directly.)  

Following the code presented top to bottom:


Document/comment your code. In the code.
What is the class about, each method, its parameters?
Don't specify sweeping includes you don't use.
Here, just use java.util.Scanner and not a single include  
Class names should be CamelCase: class SimplestSum
provided arithmetic assignment operators and conditional expressions, I'd code accumulating
totalSum += z * (mul &lt; b ? k*a : (b-count)+1);  
you introduce a variable for k*a, but use it in one place out of three, only.
at the end of simplestSum()'s code, I think it does try and use a series: explain in the method comment.
Accumulation may exceed the range of int (applies to maxSum() as well)
maxSum()'s indentation is off ever so slightly
maxSum() does not try and use a series
do not open code closing AutoCloseables: use try-with-resources  
in main(), using single letter variable names from the problem statement suggests itself - not so for nQueries.
And why introduce another variable, why name it a0 (instead of query or even q (OK for an iteration variable in an inner loop, especially when not used otherwise))
a and b are input using java.util.Scanner.nextInt() where the Constraints allow ≤ 10^18
depending on where and how large inputs are handled, this will necessitate declaring variables/parameters to handle numbers beyond the range of int more likely than not.