| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -22,14 +22,14 @@ svg_end() {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void
 | 
					 | 
					 | 
					 | 
					void
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					svg_text(double TEXT_LEFT, double BASELINE, string text) {
 | 
					 | 
					 | 
					 | 
					svg_text(double TEXT_LEFT, double BASELINE, string text, size_t bukva_scale) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        cout << "<text x='" << TEXT_LEFT << "' y='"<< BASELINE <<"'> " << text << "</text>";
 | 
					 | 
					 | 
					 | 
					        cout << "<text x='" << TEXT_LEFT << "' font-size = '" << bukva_scale << "' y='"<< BASELINE <<"'> " << text << "</text>";
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void svg_rect(double TEXT_WIDTH, double top, double bin_width, double BIN_HEIGHT){
 | 
					 | 
					 | 
					 | 
					void svg_rect(double TEXT_WIDTH, double top, double bin_width, double BIN_HEIGHT, string grad){
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    cout << "<rect x='"<<TEXT_WIDTH<<"' y='"<<top<<"' width='"<<bin_width<<"' height='"<<BIN_HEIGHT<<"' stroke ='cyan' fill='#fce166' />\n";
 | 
					 | 
					 | 
					 | 
					    cout << "<rect x='"<<TEXT_WIDTH<<"' y='"<<top<<"' width='"<<bin_width<<"' height='"<<BIN_HEIGHT<<"' stroke ='cyan' fill='#"<<grad<<grad<<grad<<"' />\n";
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void
 | 
					 | 
					 | 
					 | 
					void
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -43,8 +43,11 @@ show_histogram_svg(const vector<size_t>& bins) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    const auto BLOCK_WIDTH = 10;
 | 
					 | 
					 | 
					 | 
					    const auto BLOCK_WIDTH = 10;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    const double SCALE = IMAGE_WIDTH - TEXT_WIDTH;
 | 
					 | 
					 | 
					 | 
					    const double SCALE = IMAGE_WIDTH - TEXT_WIDTH;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    size_t grad = 0;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    double max_count = 0;
 | 
					 | 
					 | 
					 | 
					    double max_count = 0;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    size_t bukva_scale = 12;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    cin >> bukva_scale;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    for (double x: bins) {
 | 
					 | 
					 | 
					 | 
					    for (double x: bins) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (x > max_count) {
 | 
					 | 
					 | 
					 | 
					        if (x > max_count) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                max_count = x;
 | 
					 | 
					 | 
					 | 
					                max_count = x;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -56,8 +59,9 @@ show_histogram_svg(const vector<size_t>& bins) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					       double top = 0;
 | 
					 | 
					 | 
					 | 
					       double top = 0;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    for (size_t i = 0; i < bins.size(); i++) {
 | 
					 | 
					 | 
					 | 
					    for (size_t i = 0; i < bins.size(); i++) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        const double bin_width = SCALE * ( bins[i] / max_count);
 | 
					 | 
					 | 
					 | 
					        const double bin_width = SCALE * ( bins[i] / max_count);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        svg_text(TEXT_LEFT, top + TEXT_BASELINE, to_string(bins[i]));
 | 
					 | 
					 | 
					 | 
					        grad = (11 - (bins[i] * 9) / max_count);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        svg_rect(TEXT_WIDTH, top, bin_width, BIN_HEIGHT);
 | 
					 | 
					 | 
					 | 
					        svg_text(TEXT_LEFT, top + TEXT_BASELINE, to_string(bins[i]), bukva_scale);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        svg_rect(TEXT_WIDTH, top, bin_width, BIN_HEIGHT, to_string(grad));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        top += BIN_HEIGHT;
 | 
					 | 
					 | 
					 | 
					        top += BIN_HEIGHT;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        cout << endl;
 | 
					 | 
					 | 
					 | 
					        cout << endl;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        cout << bin_width;
 | 
					 | 
					 | 
					 | 
					        cout << bin_width;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |