codeparrot/codecomplex huggingface dataset:
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
/*
* Author: Nikhil Garg
* Date:   2010-12-05
*
*/
import java.io.*;
import java.util.*;
import java.math.*;

public class javatemp
{
	static String map(int a)
	{
		if( a == 0) return "S";
		else if ( a == 1 ) return "M";
		else if ( a == 2 ) return "L";
		else if ( a == 3 ) return "XL";
		else if ( a == 4 ) return "XXL";
		return "";
	}
	
	public static void main(String[] args) throws IOException
	{
		BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
		int ans = 1000;
		in.readLine();
		String s = in.readLine();
		int H = 0;
		for(int i =0; i < s.length(); i++)
			if( s.charAt(i) == 'H') H++;

		
		for(int i = 0; i < s.length(); i++)
		{
			int count = 0;
			for(int j = 0; j < H; j++)
				if( s.charAt( (i +j) % s.length()) =='T') count ++;
			ans = Math.min ( ans, count);
		}
		System.out.println(ans);

	}
	
	
	static void debug(Object...os)
	{
		System.out.println(Arrays.deepToString(os));
	}
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.sort;

public class Main {
	public static void main(String[] args) throws IOException {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					try {
						if (new File("input.txt").exists())
							System.setIn(new FileInputStream("input.txt"));
					} catch (SecurityException e) {}
					new Main().run();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}, "1", 1L << 24).start(); 
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");
	
	int N;
	int[] a;
	int[] b;
	int[] c;
	
	int T, H;
	
	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		
		N = nextInt();
		char[] s = nextToken().toCharArray();
		a = new int [N];
		
		H = 0;
		T = 0;
		
		for (int i = 0; i < s.length; i++) {
			a[i] = s[i] == 'T' ? 1 : 0;
			if (s[i] == 'T')
				T++;
			else
				H++;
		}
		
		if (T == 1 || H == 1) {
			out.println(0);
			out.close();
			return;
		}
		
		b = Arrays.copyOf(a, a.length);
		c = Arrays.copyOf(a, a.length);
		sort(c);
		
		int ans = 100000000;
		for (int o = 0; o < N; o++) {
			for (int i = 0; i < N; i++)
				b[(i + o) % N] = a[i];
			int cur = 0;
			for (int i = 0; i < N; i++)
				if (b[i] != c[i])
					cur++;
			ans = min(ans, cur / 2);
		}
		
		out.println(ans);
		
		out.close();
	}
	
	String nextToken() throws IOException {
		while (!st.hasMoreTokens()) {
			st = new StringTokenizer(in.readLine());
		}
		
		return st.nextToken();
	}
	
	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
	
	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}
	
	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	
	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}
	
	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			
			if (s == null) {
				return true;
			}
			
			st = new StringTokenizer(s);
		}
		
		return false;
	}
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;

public class C43 implements Runnable {

    public Scanner in;

    public PrintWriter out;

    final static String TASK_NAME = "";

    C43() throws IOException {
        in = new Scanner( System.in );
        // in = new StreamTokenizer( new InputStreamReader( System.in ) );
        out = new PrintWriter( System.out );
    }

    void close() throws IOException {
        out.close();
    }

    public void run() {
        try {
            solve();
            close();
        } catch ( Exception e ) {
            e.printStackTrace();
        }
    }

    public void solve() throws IOException {
        int n = in.nextInt();
        char[] c = in.next().toCharArray();
        int t = 0;
        for ( int i = 0; i < n; i ++ ) {
            if ( c[i] == 'T' ) {
                t ++;
            }
        }
        int ct = 0;
        for ( int i = 0; i < t; i ++ ) {
            if ( c[i] == 'T' ) {
                ct ++;
            }
        }
        int r = 0;
        for ( int i = 0; i < n; i ++ ) {
            r = Math.max( r, ct );
            if ( c[i] == 'T' ) {
                ct --;
            }
            if ( c[( i + t ) % n] == 'T' ) {
                ct ++;
            }
        }
        out.println( t - r );
    }

    public static void main( String[] args ) throws IOException {
        new Thread( new C43() ).start();
    }
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
//package round43;

import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class C {
	Scanner in;
	PrintWriter out;
	String INPUT = "";
	
	void solve()
	{
		int n = ni();
		char[] x = in.next().toCharArray();
		int t = 0;
		for(int i = 0;i < n;i++){
			if(x[i] == 'T'){
				t++;
			}
		}
		
		int min = 9999;
		for(int i = 0;i < n;i++){
			int y = 0;
			for(int j = i;j < i + t;j++){
				if(x[j % n] == 'T'){
					y++;
				}
			}
			min = Math.min(min, t - y);
		}
		out.println(min);
	}
	
	void run() throws Exception
	{
		in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
		out = new PrintWriter(System.out);

		solve();
		out.flush();
	}
	
	
	public static void main(String[] args) throws Exception
	{
		new C().run();
	}
	
	int ni() { return Integer.parseInt(in.next()); }
	void tr(Object... o) { if(INPUT.length() != 0)System.out.println(o.length > 1 || o[0].getClass().isArray() ? Arrays.deepToString(o) : o[0]); }
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.io.*;
import java.util.*;

public class Solution {
    static BufferedReader br=null;
    static PrintWriter pw=null;
    static StringTokenizer st=null;
    static String FILENAME="";
    
    void nline(){
        try {
            st=new StringTokenizer(br.readLine());
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    int ni(){
        while(st==null || !st.hasMoreTokens()) nline();
        return Integer.parseInt(st.nextToken());
    }
    long nl(){
        while(st==null || !st.hasMoreTokens()) nline();
        return Long.parseLong(st.nextToken());
    }
    double nd(){
        while(st==null || !st.hasMoreTokens()) nline();
        return Double.parseDouble(st.nextToken());
    }
    String ns(){
        while(st==null || !st.hasMoreTokens()) nline();
        return st.nextToken();
    }
    String nstr(){
        String s="";
        try {
            s=br.readLine();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return s;
    }

    public void solve(){
        int n = ni();
        String s = nstr();
        int[] a = new int[n];
        for (int i=0;i<n;i++)
            a[i]=s.charAt(i)=='H'?0:1;
        int hc = 0;
        for (int i=0;i<n;i++)
            if (a[i]==0) hc++;
        int min = 1000000;
        for (int ss=0;ss<n;ss++) {
            int rc = 0;
            for (int i=0;i<hc;i++)
                if (a[(i+ss)%n]==0) rc++;
            if (hc-rc<min) min=hc-rc;
        }
        pw.print(min);
    }
    public void run(){
        solve();
        pw.close();
    }
    public static void main(String[] args) {
            br = new BufferedReader(new InputStreamReader(System.in));
            pw = new PrintWriter(System.out);
        
        new Solution().run();
    }

}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.io.BufferedInputStream;
import java.util.Scanner;

public class HamstersAndTigers { //Round #XX - Hamsters and Tigers
	public static void main(String[] args) {
		Scanner sc = new Scanner(new BufferedInputStream(System.in));

		int numAnimals = sc.nextInt();
		String positions = sc.next();

		int numTigers = 0;
		int numHamsters = 0;
		for(int i = 0; i < positions.length(); i++) {
			if(positions.charAt(i) == 'T') {
				numTigers++;
			} else {
				numHamsters++;
			}
		}

		int minDifference = Integer.MAX_VALUE;

		StringBuilder tigerChars = new StringBuilder(1000);
		StringBuilder hamsterChars = new StringBuilder(1000);
		for(int i = 0; i < numHamsters; i++) {
			hamsterChars.append('H');
		}
		StringBuilder remainingTigerChars = new StringBuilder(1000);
		for(int i = 0; i < numTigers; i++) {
			remainingTigerChars.append('T');
		}

		for(int i = 0; i <= numTigers; i++) {
			StringBuilder generated = new StringBuilder();
			generated.append(tigerChars);
			generated.append(hamsterChars);
			generated.append(remainingTigerChars);
			
			//System.out.println(generated);

			if(remainingTigerChars.length() >= 1) {
				remainingTigerChars.deleteCharAt(remainingTigerChars.length() - 1);
			}
			tigerChars.append('T');

			int diffCount = stringDiffCount(positions, generated.toString());
			if(diffCount < minDifference) {
				minDifference = diffCount;
			}
		}

		//System.out.println("");

		hamsterChars = new StringBuilder(1000);
		tigerChars = new StringBuilder(1000);
		for(int i = 0; i < numTigers; i++) {
			tigerChars.append('T');
		}
		StringBuilder remainingHamsterChars = new StringBuilder(1000);
		for(int i = 0; i < numHamsters; i++) {
			remainingHamsterChars.append('H');
		}

		for(int i = 0; i <= numHamsters; i++) {
			StringBuilder generated = new StringBuilder();
			generated.append(hamsterChars);
			generated.append(tigerChars);
			generated.append(remainingHamsterChars);

			//System.out.println(generated);

			if(remainingHamsterChars.length() >= 1) {
				remainingHamsterChars.deleteCharAt(remainingHamsterChars.length() - 1);
			}
			hamsterChars.append('H');

			int diffCount = stringDiffCount(positions, generated.toString());
			if(diffCount < minDifference) {
				minDifference = diffCount;
			}
		}

		System.out.println(minDifference / 2);
	}

	private static int stringDiffCount(String strOne, String strTwo) {
		int diffCount = 0;
		for(int i = 0; i < strOne.length(); i++) {
			if(strOne.charAt(i) != strTwo.charAt(i)) {
				diffCount++;
			}
		}
		return diffCount;
	}
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.util.*;


public class Main{
    
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int[] a=new int[1010];
        while(in.hasNext()){
            int n=in.nextInt();
            String s=in.next();
            int sum=0;
            for(int i=0;i<n;++i){
                if(s.charAt(i)=='H'){
                    a[i]=1;
                    ++sum;
                }
                else a[i]=0;
            }
            int min=10010;
            for(int i=0;i<n-sum;++i){
                int count=0;
                for(int j=i+sum;j<n;++j){
                    if(a[j]==1)++count;
                }
                for(int j=0;j<i;++j){
                    if(a[j]==1)++count;
                }
                if(count<min)min=count;
            }
            sum=n-sum;
            for(int i=0;i<n-sum;++i){
                int count=0;
                for(int j=i+sum;j<n;++j){
                    if(a[j]==0)++count;
                }
                for(int j=0;j<i;++j){
                    if(a[j]==0)++count;
                }
                if(count<min)min=count;
            }
            System.out.println(min);
        }
    }
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.util.Scanner;


public class ProblemC {

    public static void main(String[] args) {
        ProblemC problem = new ProblemC();
        problem.solve();
    }

    private void solve() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int ret = n;
        int toth = 0;
        int tott = 0;
        for (int j = 0; j < n; j++) {
            if (s.charAt(j) == 'H') {
                toth++;
            } else {
                tott++;
            }
        }
        for (int j = 0; j < n; j++) {
            int cnth = 0;
            for (int k = 0; k < toth; k++) {
                int pos = (j + k) % n;
                if (s.charAt(pos) == 'H') {
                    cnth++;
                }
            }
            int makeh = toth - cnth;
            ret = Math.min(ret, makeh);
        }
        System.out.println(ret);
    }

}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.util.*;
import java.math.*;
import static java.lang.Character.isDigit;
import static java.lang.Character.isLowerCase;
import static java.lang.Character.isUpperCase;
import static java.lang.Math.*;
import static java.math.BigInteger.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Character.isDigit;

public class Main{
    public static void main(String[] args) {
        new Main().run();
    }
    Scanner sc=new Scanner(System.in);
    void run() {
        int n=sc.nextInt();
        char[] cs=sc.next().toCharArray();
        int h=0;
        for(int i=0;i<n;i++)if(cs[i]=='H')h++;
        int res=n;
        for(int i=0;i<n;i++) {
            int val=0;
            for(int j=0;j<h;j++)if(cs[(i+j)%n]=='T')val++;
            res=min(res,val);
        }
        System.out.println(res);
    }
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear

import com.sun.org.apache.xpath.internal.axes.SubContextList;
import java.util.Scanner;

/**
 *
 * @author Madi
 */
public class Round42CC {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        String s = sc.nextLine();

        int k = 0;
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == 'H') {
                k++;
            }
        }

        s = s + s.substring(0, k);
        String ss = "";

        int max = 0;
        for (int i = 0; i < s.length() - k; i++) {
            ss = s.substring(i, i + k);
            int count = 0;
            for (int j = 0; j < ss.length(); j++) {
                if (ss.charAt(j) == 'H') {
                    count++;
                }
            }
            if (count > max) {
                max = count;
            }
        }
        
        System.out.println(k - max);
    }
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.io.PrintWriter;
import java.util.*;


public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		// 1 = H, 0 = T
		
		int n = in.nextInt();
		String line = in.next();
		int h = 0;
		for (int i = 0; i < line.length(); i++) {
			if(line.charAt(i)=='H') h++;
		}
		line = line + line;
		
		int min = Integer.MAX_VALUE;
		for (int i = 0; i < n; i++) {
			int ans = 0;
			for (int j = i; j < i+h; j++) {
				if(line.charAt(j)!='H') ans++;
			}
			if(min>ans) min = ans;
		}
		
		out.print(min);
		
		
		
		
		in.close();
		out.close();
	}

}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.io.*;
import java.util.*;


public class HamstersAndTigers
{
	Scanner in;
	PrintWriter out;
	
	HamstersAndTigers()
	{
		in = new Scanner(System.in);
		out = new PrintWriter(System.out);
	}
	
	HamstersAndTigers(String i, String o) throws FileNotFoundException
	{
		in = new Scanner(new File(i));
		out = new PrintWriter(new File(o));
	}
	
	public void finalize()
	{
		out.flush();
		in.close();
		out.close();
	}
	
	void solve()
	{
		int i = 0,
			h = 0,
			n = in.nextInt();
		
		String buf = "";
		char[] ht = in.next().toCharArray();
		
		for(i = 0; i < n; ++i)
			if(ht[i] == 'H')
				++h;
		
		for(i = 0; i < h; ++i)
			buf += 'H';
		
		for(i = 0; i < n - h; ++i)
			buf += 'T';
		
		int diff = (1 << 28);
		for(i = 0; i < n; ++i)
		{
			int tmp = 0;
			
			for(int j = 0; j < n; ++j)
				if(buf.charAt(j) != ht[(i + j) % n])
					++tmp;
			
			diff = Math.min(tmp, diff);
		}
		
		out.println(diff / 2);
	}
	
	public static void main(String[] args) throws FileNotFoundException
	{
		HamstersAndTigers t = new HamstersAndTigers();
		t.solve();
		t.finalize();
	}
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		
		int size= Integer.parseInt(r.readLine());
		String line = r.readLine();
		
		int counter =0;
		for (int i = 0; i < line.length(); i++) {
			if(line.charAt(i)=='H')counter++;
		}
		
		int minimum = Integer.MAX_VALUE;
		for (int i = 0; i < line.length(); i++) {
			if(line.charAt(i)=='H'){
				int current = 0;
				for (int j = i; j < i+counter; j++) {
					if(line.charAt(j%line.length())=='T')current++;
				}
				minimum = Math.min(current, minimum);
			}
		}
		
		System.out.println(minimum);
		
	}
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
import java.math.*;

public class Main implements Runnable {
	BufferedReader in;
	PrintStream out;  
	StringTokenizer st = new StringTokenizer("");
	static boolean local = false;
	
	public static void main(String [] args) throws Exception {
		if (args.length > 0) local = true;
		new Thread(new Main()).start();
	}

	void printExit(String s) {
		out.println(s);
		System.exit(0);
	}

	public void run() {
		try {
			Locale.setDefault(Locale.US);
			in = local ? new BufferedReader(new FileReader("input.txt")) : new BufferedReader(new InputStreamReader(System.in));
			out = local ? new PrintStream(new File("output.txt")) : new PrintStream(System.out);
			int n = nextInt();
			char [] c = in.readLine().toCharArray();
			int t = 0;
			for (int i = 0; i < n; i++)
				if (c[i] == 'T') t++;

			int ans = n;
			for (int i = 0; i < n; i++) {
				int cnt = 0;
				for (int j = 0; j < t; j++)
					if (c[(i + j) % n] == 'H')
						cnt++;
				ans = min(ans, cnt);
			}

			out.println(ans);

		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}

	boolean seekForToken() {
 		try {
			while (!st.hasMoreTokens()) {
				String s = in.readLine();
				if (s == null) {
				 	return false;
				}
			 	st = new StringTokenizer(s);
			}
			return true;
		}
		catch (IOException e) {
		 	e.printStackTrace();
		 	return false;
		}
 	}

 	int nextInt() {
		return Integer.parseInt(nextToken());
 	}

 	long nextLong() {
		return Long.parseLong(nextToken());
 	}

 	double nextDouble() {
		return Double.parseDouble(nextToken());
 	}

 	BigInteger nextBigInteger() {
 	 	return new BigInteger(nextToken());
 	}

 	String nextToken() {
 	 	seekForToken();
 	 	return st.nextToken();
 	}

}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear

import java.util.Scanner;

/**
 *
 * @author igor_kz
 */
public class C46 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int number = in.nextInt();
        String s = in.next();
        int cH = 0;
        int n = s.length();
        for (int i = 0 ; i < n ; i++)
            if (s.charAt(i) == 'H') cH++;
        String ss = "";
        for (int i = 0 ; i < cH ; i++)
            ss += "H";
        for (int i = 0 ; i < n - cH ; i++)
            ss += "T";
        int res = Integer.MAX_VALUE;
        for (int i = 0 ; i < n ; i++) {
            int cur = countDifference(ss , s);
            res = Math.min(res , cur);
            ss = ss.substring(1) + ss.charAt(0);
        }
        System.out.println(res);
    }

    public static int countDifference(String ss, String s) {
        int cnt = 0;
        for (int i = 0 ; i < ss.length() ; i++)
            if (ss.charAt(i) != s.charAt(i)) cnt++;
        return cnt / 2;
    }
}
// Problem: 46_C. Hamsters and Tigers
// Time complexity: linear
//package round43;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class C {

	static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
	static StringTokenizer st;
	static PrintWriter out = new PrintWriter(System.out);
	
	static String nextToken() throws IOException{
		while (st==null || !st.hasMoreTokens()){
			String s = bf.readLine();
			if (s == null)
				return null;
			st = new StringTokenizer(s);
		}
		
		return st.nextToken();
	}
	
	static int nextInt() throws IOException{
		return Integer.parseInt(nextToken());
	}
	
	static String nextStr() throws IOException{
		return nextToken();
	}
	
	static int f(byte s[], int n){
		int l = 0,
			r = n-1;
		int res = 0;
		
		do{
			while (l<n && s[l]=='H')
				l++;
			while (r>=0 && s[r]=='T')
				r--;
			
			if (l < r){
				res++;
			}
			l++;
			r--;
		}
		while (l < r);
		
		return res;
	}
	
	public static void main(String[] args) throws IOException{
		int n = nextInt();
		byte s[] = nextStr().getBytes();
		
		int res = f(s, n);
		for (int i=1; i<n; i++){
			byte c = s[0];
			for (int j=0; j<n-1; j++)
				s[j] = s[j+1];
			s[n-1] = c;
			res = Math.min(res, f(s, n));
		}
		
		out.println(res);
		out.flush();
	}

}
// Problem: 468_B. Two Sets
// Time complexity: linear
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;


public class Main {
	
	static int n;
	static int a;
	static int b;
	static int g;
	static int ref;
	static int refg;
	static HashSet<Integer> cgroup;
	static HashMap<Integer,Integer> indexmap;
	static HashSet<Integer> nums;
	static HashSet<Integer> used;
	
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt();
		a = scan.nextInt();
		b = scan.nextInt();
		
		boolean[] where = new boolean[n];
		indexmap = new HashMap<Integer,Integer>();
		used = new HashSet<Integer>();
		nums = new HashSet<Integer>();
		
		if (a==b)
			b = 0;
		
		for (int i = 0; i<n; i++) {
			int x = scan.nextInt();
			nums.add(x);
			indexmap.put(x,i);
		}
		scan.close();
		
		for (int x : nums) {
			if (used.contains(x))
				continue;
			cgroup = new HashSet<Integer>();
			cgroup.add(x);
			g = -1;
			refg = -1;
			ref = -1;
			used.add(x);
			if (!spawn(x,a,b) || !spawn(x,b,a)) {
				System.out.println("NO");
				return;
			}
			if (cgroup.size()%2==1 && ref == -1) {
				System.out.println("NO");
				return;
			} else {
				boolean w = true;
				if (g == a)
					w = false;
				for (int k : cgroup) {
					where[indexmap.get(k)] = w;
				}
			}
		}
		
		System.out.println("YES");
		for (int i = 0; i<where.length; i++)
			if (where[i])
				System.out.print("1 ");
			else
				System.out.print("0 ");
		
	}

	private static boolean spawn(int x, int ab, int abo) {
		int xab = ab-x;
		if (xab == x) {
			ref = x;
			refg = ab;
		} else {
			if (nums.contains(xab)) {
				cgroup.add(xab);
				used.add(xab);
				spawn(xab,abo,ab);
			} else {
				if (g == -1)
					g = abo;
				else if (g != abo) {
					return false;
				}
			}
		}
		return true;
	}

}