####準備
[C#でAtCoderデビューのための準備]
(https://qiita.com/azumabashi/items/7aa9e4b77c10970cc30a)
のあとで AtCoder Beginners Selection をやってみました。
####問題文
ABC085C - Otoshidama
[https://atcoder.jp/contests/abs/tasks/abc085_c]
(https://atcoder.jp/contests/abs/tasks/abc085_c)
####提出結果
using System;
using System.Linq;
class Program
{
static void Main(string[] args)
{
long[] array = Console.ReadLine().Split().Select(long.Parse).ToArray();
long N = array[0];
long Y = array[1] / 1000;
long x = -1;
long y = -1;
long z = -1;
bool ari = false;
for (long ix = N; ix >= 0; ix--)
{
for (long iy = N - ix; iy >= 0; iy--)
{
long iz = N - ix - iy;
if ((10 * ix) + (5 * iy) + iz == Y)
{
x = ix;
y = iy;
z = iz;
ari = true;
break;
}
}
if (ari) break;
}
Console.WriteLine($"{x} {y} {z}");
}
}