시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 256 MB | 123 | 45 | 40 | 44.444% |
Miss Fotheringale is teaching her maths class about plotting graphs. As a first exercise, she wants them to plot a linear graph y = ax + b for values of x from 0 to 10 inclusive.
She wants you to help by writing a program that outputs the correct answers to make it easier for her to mark her pupils' work.
The first line of input is a single number N, 0 < N < 30, a positive integer that tells the number of graphs to be plotted.
N lines then follow, each representing one graph to be plotted. Each line contains 2 non-negative integers, A and B, 0 <= A, B <10, being the values of a and b for the graph. A and B will not both be 0.
For each graph, firstly output the equation being plotted on a line by itself. Under this must be the graph. All points on the axes, plus points on the graph must be represented by the * character. The x axis must contain the points 0 to 10 from left to right, the y axis the points 0 to the maximum value from bottom to top.
2 1 0 2 2
y = 1x + 0 * * * * * * * * * * * * * * * * * * ** *********** y = 2x + 2 * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * * ***********
ICPC > Regionals > South Pacific > South Pacific Region > New Zealand Programming Contest > NZPC 2015 G번