Entrance Exams

0

0 votes
Problem

Recently you took the IITJEE,AIEEE,BITSAT and many other exams.Each paper had MCQ question with marking scheme +x and -y and had n questions.
Now your father would ask you following question after every exam:

1.What was the marking scheme?
your answer: +x -y
2.How many questions did you do?
your answer: 'all' or 'some'
3.How many diferent scores can you get?
your answer(after a few hours): c (the total no of different score possible)
4.What are your expected marks?In how many different ways can you get it?
d: number of ways to get e marks

Input Format:
First line has number of Test Cases.
For Each Test Case we have one line
x: marks for correct answer,
y: makrs for incorrect,
n: total number of questions,
1/0: no of questions done,
1- all
0- some
e: expected marks


Output Format:
for each test case print:
c : number of different scores he can get in the exam
d : number of ways to get e marks
in same line space separated.

Constraints:
T < 4000
x <= 10
y <= x
n <= 10000
e <= n*x

Correction: for expected marks don't consider all or some.

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?