//IncreaseList
using System;
using System.Collections;
using System.Collections.Generic;
public class test2
{
public void IncreaseList(int start,ArrayList list , int n, int k)
{
if(list.Count==k)
{ for(int i = 0 ; i< list.Count; i++)
{
Console.Write(list[i] + " ");
}
Console.WriteLine();
}
for(int i=start;i<=n; i++)
{
list.Add(i);
IncreaseList( i+1,list,n,k );
list.Remove(i);
}
}
}
public class Test
{
public static void Main()
{
ArrayList list = new ArrayList();
test2 t= new test2();
t.IncreaseList(1,list,6,5);
}
}
Ly9JbmNyZWFzZUxpc3QKdXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnM7CnVzaW5nIFN5c3RlbS5Db2xsZWN0aW9ucy5HZW5lcmljOwoKcHVibGljIGNsYXNzIHRlc3QyCnsKCXB1YmxpYyB2b2lkIEluY3JlYXNlTGlzdChpbnQgc3RhcnQsQXJyYXlMaXN0IGxpc3QgLCBpbnQgbiwgaW50IGspCgl7CgkJCgkJaWYobGlzdC5Db3VudD09aykKCQl7IGZvcihpbnQgaSA9IDAgOyBpPCBsaXN0LkNvdW50OyBpKyspCgkJCXsKCQkJCUNvbnNvbGUuV3JpdGUobGlzdFtpXSArICIgIik7CgkJCQkKCQkJfQoJCQlDb25zb2xlLldyaXRlTGluZSgpOwoJCX0KCQkKCQlmb3IoaW50IGk9c3RhcnQ7aTw9bjsgaSsrKQoJCXsKCQkJbGlzdC5BZGQoaSk7CgkJCUluY3JlYXNlTGlzdCggaSsxLGxpc3QsbixrICk7CgkJCWxpc3QuUmVtb3ZlKGkpOwoJCX0KCQoJfQp9CgpwdWJsaWMgY2xhc3MgVGVzdAp7CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CgkJQXJyYXlMaXN0IGxpc3QgPSBuZXcgQXJyYXlMaXN0KCk7CgkJdGVzdDIgdD0gbmV3IHRlc3QyKCk7CgkJdC5JbmNyZWFzZUxpc3QoMSxsaXN0LDYsNSk7CgoJfQp9