/* package whatever; // don"t place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;



/**
 * An array with special operations.  
 * @param <T> the type of elements in this array
 *
 * @author  Igor Mazurok
 */
 
interface SegmentedArray<T> {
   /**
	* <p>Get value by element index</p>
	* @param index index of element.
	* @return  Value of element with specified index.
	*/
	T get(int index);
 
   /**
	* <p>Set the same value for all elements in the specified index range</p>
	* @param start the beginning index, inclusive.
	* @param end the ending index, exclusive.
	* @param value value for .
	* @return This object.
	*/
	SegmentedArray<T> set(int start, int end, T value);
 
   /**
	* <p>Returns the index within this array of the first occurrence of the specified value,
	* starting at the specified index. If no such value of k exists, then -1 is returned.</p>
	* @param value the T-based value for which to search.
	* @param fromIndex the index from which to start the search.
	* @return the index within this array of the first occurrence of the element with specified value,
	* starting at the specified index.
	*/
	int indexOf(T value, int fromIndex);
 
   /**
	* <p>Find minimum value in the specified indexes range</p>
	* @param start the beginning index, inclusive.
	* @param end the ending index, exclusive.
	* @return Minimum value.
	*/
	T minValue(int from, int to);
}

class DummyArray implements SegmentedArray<Integer> {
	public Integer get(int index){
		return 0;
	}

	public SegmentedArray<Integer> set(int start, int end, Integer value){
		return this;
	}
 
   
	public int indexOf(Integer value, int fromIndex){
		return 0;
	}
 
  
	public Integer minValue(int from, int to){
		return 0;
	}
	
}

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void testSegmentedArray1(SegmentedArray<Integer> arr) {
		long start = System.nanoTime();
			
		//Предположим что параметром метода является 
		//нулевой массив размера 1000
		if (arr.get(30)!=0)
			System.out.println("Non zero element in empty array");
		if (arr.minValue(0,1000)!=0)
			System.out.println("Non zero minimum in empty array");
		arr.set(0,200,1);
		arr.set(100,300,2);
		arr.set(150,160,1);
		if (arr.get(30)!=1)
			System.out.println("Element is not set");
		if (arr.get(300)!=0)
			System.out.println("End should be exclusive");	
		if (arr.get(125)!=2)
			System.out.println("Element is not set (2 assigments)");
		if (arr.get(150)!=1)
			System.out.println("Element is not set (3 assigments)");	
		if (arr.minValue(100,300)!=1)
			System.out.println("Wrong minimum calculation (two values)");
		if (arr.minValue(100,301)!=0)
			System.out.println("Wrong minimum calculation (two values and zero)");
		if (arr.minValue(155,156)!=1)
			System.out.println("Wrong minimum calculation (single element)");
			
		long finish = System.nanoTime();
			
		System.out.println("Test 1 (small array) completed!");
		System.out.format("Time elapsed: %.3f ms", (finish-start)/1e6); // ns -> ms
				
	}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		testSegmentedArray1(new DummyArray());
	}
}