using System;
using System.Collections.Generic;
using System.Reflection;
class Program
{
static void Main()
{
for (int TestNo = 1; TestNo <= 100; TestNo++) {
List<string> TestDataList = CreateTestDataList(TestNo);
Console.WriteLine("テストデータ{0}", TestNo);
TestDataList.ForEach(X => Console.WriteLine(X));
string FileName = string.Format("TestDate{0}.txt", TestNo.ToString().PadLeft(3, '0'));
string txtFileFullPath = Assembly.GetExecutingAssembly().Location;
txtFileFullPath = System.IO.Path.GetDirectoryName(txtFileFullPath);
txtFileFullPath = System.IO.Path.Combine(txtFileFullPath, FileName);
System.IO.File.WriteAllLines(txtFileFullPath, TestDataList.ToArray(),
System.Text.Encoding.GetEncoding("Shift_JIS"));
}
}
static List<string> CreateTestDataList(int pTestNo)
{
var WillReturn = new List<string>();
if (pTestNo == 1) {
WillReturn.Add("6 4");
WillReturn.Add("5");
WillReturn.Add("2 3 1 2 6 5");
return WillReturn;
}
if (pTestNo == 2) {
WillReturn.Add("4 1");
WillReturn.Add("100000000000000000000");
WillReturn.Add("2 3 4 1");
return WillReturn;
}
if (pTestNo == 3) {
WillReturn.Add("8 1");
WillReturn.Add("1");
WillReturn.Add("2 3 4 5 3 2 4 5");
return WillReturn;
}
var InsRnd = new Random(pTestNo);
const int 単語数上限 = 10;
const int ステップ数上限 = 20;
int N = InsRnd.Next(2, 単語数上限 + 1);
int a = InsRnd.Next(1, N + 1);
int k = InsRnd.Next(1, ステップ数上限 + 1);
int[] BArr = new int[N + 1];
for (int I = 1; I <= BArr.GetUpperBound(0); I++) {
while (true) {
BArr[I] = InsRnd.Next(1, N + 1);
if (BArr[I] != I) break;
}
}
WillReturn.Add(string.Format("{0} {1}", N, a));
WillReturn.Add(k.ToString());
var sb = new System.Text.StringBuilder();
for (int I = 1; I <= BArr.GetUpperBound(0); I++) {
sb.Append(BArr[I]);
if (I < BArr.GetUpperBound(0))
sb.Append(' ');
}
WillReturn.Add(sb.ToString());
return WillReturn;
}
}