시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB123454044.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.

예제 입력 1

2
1 0
2 2

예제 출력 1

y = 1x + 0
*         *
*        * 
*       *  
*      *   
*     *    
*    *     
*   *      
*  *       
* *        
**         
***********
y = 2x + 2
*         *
*          
*        * 
*          
*       *  
*          
*      *   
*          
*     *    
*          
*    *     
*          
*   *      
*          
*  *       
*          
* *        
*          
**         
*          
*          
*          
***********

출처

ICPC > Regionals > South Pacific > South Pacific Region > New Zealand Programming Contest > NZPC 2015 G번

  • 잘못된 데이터를 찾은 사람: zych1751