{% extends "problem.md.jinja" %}

{% block input_file %}
	{%- if prob['type'] == 'output' -%}
		{{ _('This is an output-only problem. There are %d input files named *%s1.in* ~ *%s%d.in*.') % (prob.test_cases.__len__(), prob['name'] if io_style == 'fio' else '', prob['name'] if io_style == 'fio' else '', prob.test_cases.__len__()) }}
	{%- elif prob['type'] == 'program' -%}
		{%- if input_file_name -%}
			{{ _('Read from the file *%s*.') % input_file_name }}
		{%- elif io_style == 'stdio' -%}
			{{ _('Read from the standard input.') }}
		{%- elif io_style == 'fio' -%}
			{{ _('Read from the file *%s.in*.') % prob['name'] }}
		{%- endif -%}
	{%- endif -%}
{% endblock %}

{% block output_file %}
	{%- if prob['type'] == 'output' -%}
		{{ _('For each input file, you should accomplish an output file named *%s1.out* ~ *%s%d.out*.') % (prob['name'] if io_style == 'fio' or prob.get('file io') else '', prob['name'] if io_style == 'fio' or prob.get('file io') else '', prob.test_cases.__len__()) }}
	{%- elif prob['type'] == 'program' -%}
		{%- if output_file_name -%}
			{{ _('Write to the file *%s*.') % output_file_name }}
		{%- elif io_style == 'stdio' -%}
			{{ _('Write to the standard output.') }}
		{%- elif io_style == 'fio' -%}
			{{ _('Write to the file *%s.out*.') % prob['name'] }}
		{%- endif -%}
	{%- endif -%}
{% endblock %}

{%- block user_path -%}
	{%- if comp == 'uoj' -%}
		[{{ _('download files') }}](/download.php?type=problem&id={{ prob['uoj id'] }})
	{%- elif comp == 'tsinsen-oj' -%}
		{{ _('download files') }}
	{%- elif comp == 'noi' -%}
		{{ _('user\'s home path') }}
	{%- else -%}
		{{ _('problem path') }}
	{%- endif -%}
{%- endblock -%}

{% block sample_text -%}
{% block title_sample %}
{% if comp == 'uoj' -%}
## {{ _('Sample') }}{{ tools.num2chinese(vars['sample_id']) if prob.lang() == 'zh-cn' and 'sample_id' in vars else '' }}
{%- endif %}
{% endblock %}

{% block sample_input_text %}
{% if comp == 'uoj' -%}
### {{ _('Input') }}
{%- else -%}
## {{ _('Sample Input %s') % (vars['sample_id'] if 'sample_id' in vars else '') }}
{%- endif %}
{% if 'show space' in vars %}
{{ render("'\\\\begin{Verbatim}[showspaces=true]'", 'tex') }}{{ render("'```plain'", 'md') }}{{ render("'<pre>'", 'html') }}
{{ render('"' + down_file((vars['sample_id'].__str__() if 'sample_id' in vars else '1') + '.in') + '"') }}
{{ render("'\\\\end{Verbatim}'", 'tex') }}{{ render("'```'", 'md') }}{{ render("'</pre>'", 'html') }}
{% else %}
```plain
{{ down_file((vars['sample_id'].__str__() if 'sample_id' in vars else '1') + '.in') }}
```
{% endif %}
{% endblock %}
{% block sample_output_text %}
{% if comp == 'uoj' -%}
### {{ _('Output') }}
{%- else -%}
## {{ _('Sample Output %s') % (vars['sample_id'] if 'sample_id' in vars else '') }}
{%- endif %}
{% if 'show space' in vars %}
{{ render("'\\\\begin{Verbatim}[showspaces=true]'", 'tex') }}{{ render("'```plain'", 'md') }}{{ render("'<pre>'", 'html') }}
{{ render('"' + down_file((vars['sample_id'].__str__() if 'sample_id' in vars else '1') + '.ans') + '"') }}
{{ render("'\\\\end{Verbatim}'", 'tex') }}{{ render("'```'", 'md') }}{{ render("'</pre>'", 'html') }}
{% else %}
```plain
{{ down_file((vars['sample_id'].__str__() if 'sample_id' in vars else '1') + '.ans') }}
```
{% endif %}
{%- endblock -%}
{%- endblock %}


{% block title_sample_description -%}
	{%- if comp == 'uoj' -%}
### {{ _('Explanation') }}
	{%- else -%}
## {{ _('Sample Explanation %s') % (vars['sample_id'] if 'sample_id' in vars else '') }}
	{%- endif -%}
{%- endblock %}

{% block sample_file -%}
## {{ _('Sample') }}{{ (tools.num2chinese(vars['sample_id']) if comp == 'uoj' and prob.lang() == 'zh-cn' else vars['sample_id']) if 'sample_id' in vars else '' }}

{{ 
	_('See *%(in)s* and *%(ans)s* in the %(path)s.') % {
		'path' : self.user_path(),
		'in' : file_name(('ex_' if comp == 'uoj' else '') + (prob['name'] if comp == 'noi' else '') + (vars['sample_id'].__str__() if  'sample_id' in vars else '1') + '.in'),
		'ans' : file_name(('ex_' if comp == 'uoj' else '') + (prob['name'] if comp == 'noi' else '') + (vars['sample_id'].__str__() if 'sample_id' in vars else '1') + '.ans')
	}
}}
{%- endblock %}

{% block title %}

{% if prob['type'] != 'output' and prob['type'] != 'hand' and (comp == 'tuoj' or comp == 'tupc' or comp == 'ccc' or comp == 'ccpc') %}
**{{ _('Time limit:') }}** {{ prob['time limit'] }} {{ _('second(s)') }} 
{% endif %}
{% if prob['type'] != 'output' and prob['type'] != 'hand' and (comp == 'tuoj' or comp == 'tupc' or comp == 'ccc') %}
**{{ _('Memory limit:') }}** {{ prob.get('memory limit', '见各测试点') }}
{% endif %}
{% if comp == 'tuoj' -%}
**{{ _('Related files:') }}** {{ self.user_path() }}
{% endif %}
{% if prob['type'] == 'output' %}
**{{ _('This is an output-only problem.') }}**
{% elif prob['type'] == 'hand' %}
{% if comp != 'hand' %}
**这是一道纸面作业。**
{% endif %}
{% elif prob['type'] == 'interactive' %}
**{{ _('This is an interactive problem.') }}**
{% endif %}
{% endblock %}
