/***************************************
*                                      *
*               全体集計               *
*                                      *
*                                      *
***************************************/

#include <iostream>
#include <cstring>
#include "snaps.h"
#include "kisosu.h"
#include "file_open.h"
#include "cntl.h"
#include "seid.h"

int Hanbetu( int shubetu );

void stat()
{
	// 変数宣言
	int nendo;
	int sotai_nendo;
	int jukyu_nenrei;
	int dankai;
	int nenrei;
	int shubetu;
	int counter;
	double OutputValue;
	double Rorei_Jukyu_Nendokan[2][SAISHUNENDO - SHONENDO + 1][2];
	double Rorei_Kyu_Jukyu_Nendokan[2][SAISHUNENDO - SHONENDO + 1][2];
	double Turo_Kyu_Jukyu_Nendokan[2][SAISHUNENDO - SHONENDO + 1][2];
	double Gonen_Jukyu_Nendokan[2][SAISHUNENDO - SHONENDO + 1][2];
	double Shogai_Ippan_Jukyu_Nendokan[2][SAISHUNENDO - SHONENDO + 1][2];
	double Shogai_20mae_Jukyu_Nendokan[2][SAISHUNENDO - SHONENDO + 1][2];
	double Shogai_Kyu_Jukyu_Nendokan[2][SAISHUNENDO - SHONENDO + 1][2];
	double Izoku_Tuma_Jukyu_Nendokan[2][SAISHUNENDO - SHONENDO + 1][2];
	double Izoku_Otto_Jukyu_Nendokan[2][SAISHUNENDO - SHONENDO + 1][2];
	double Izoku_Ko_Jukyu_Nendokan[2][SAISHUNENDO - SHONENDO + 1];
	
	char Shisan_Naiyou[1000];
	char NaiyouSaibou[100];
	
	// ゼロクリア
	for( shubetu = 0 ; shubetu <= 1 ; shubetu++ )
	{
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			sotai_nendo = nendo - SHONENDO;
			
			for( counter = 0 ; counter <= 1 ; counter++ )
			{
				Rorei_Jukyu_Nendokan[shubetu][sotai_nendo][counter] = 0.;
				Rorei_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][counter] = 0.;
				Turo_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][counter] = 0.;
				Gonen_Jukyu_Nendokan[shubetu][sotai_nendo][counter] = 0.;
				Shogai_Ippan_Jukyu_Nendokan[shubetu][sotai_nendo][counter] = 0.;
				Shogai_20mae_Jukyu_Nendokan[shubetu][sotai_nendo][counter] = 0.;
				Shogai_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][counter] = 0.;
				Izoku_Tuma_Jukyu_Nendokan[shubetu][sotai_nendo][counter] = 0.;
				Izoku_Otto_Jukyu_Nendokan[shubetu][sotai_nendo][counter] = 0.;
			}
			Izoku_Ko_Jukyu_Nendokan[shubetu][sotai_nendo] = 0.;
		}
	}
	
	for( shubetu = 1 ; shubetu <= MAX_SHUBETU - 1 ; shubetu++ )
	{
		if( shubetu == 2 || shubetu == 3 || shubetu == 5 || shubetu == 6 )
		{
			for( nendo = SAISHUNENDO ; nendo >= SHONENDO + 2 ; nendo-- )
			{
				sotai_nendo = nendo - SHONENDO;
				
				// 年度間値へ変換
				if( nendo == 2016 )
				{
					Hiho_Kei[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					 = ( Hiho_Kei[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM] + Hiho_Kei[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					   + Part_Taishou[shubetu][1][HIHO_NENREI_SUM][1] ) / 2.
					 - ( Part_Taishou[shubetu][1][HIHO_NENREI_SUM][0] + Part_Taishou[shubetu][1][HIHO_NENREI_SUM][1] ) / 2.
					 * ( 16 - 10 ) / 12.;
					Hiho_Noufu[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					 = ( Hiho_Noufu_P[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM] + Hiho_Noufu[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					   + Part_Noufu[shubetu][1][HIHO_NENREI_SUM][1] ) / 2.
					 - ( Part_Noufu[shubetu][1][HIHO_NENREI_SUM][0] + Part_Noufu[shubetu][1][HIHO_NENREI_SUM][1] ) / 2.
					 * ( 16 - 10 ) / 12.;
					for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
					{
						Hiho_Menjo[shubetu][sotai_nendo][HIHO_NENREI_SUM][dankai]
						 = ( Hiho_Menjo_P[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM][dankai]
						   + Hiho_Menjo[shubetu][sotai_nendo][HIHO_NENREI_SUM][dankai] + Part_Menjo[shubetu][1][HIHO_NENREI_SUM][dankai][1] ) / 2.
						 - ( Part_Menjo[shubetu][1][HIHO_NENREI_SUM][dankai][0] + Part_Menjo[shubetu][1][HIHO_NENREI_SUM][dankai][1] ) / 2.
						 * ( 16 - 10 ) / 12.;
					}
					Fuka_Hiho[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					 = ( Fuka_Hiho_P[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM] + Fuka_Hiho[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					   + Part_Fuka[shubetu][1][HIHO_NENREI_SUM][1] ) / 2.
					 - ( Part_Fuka[shubetu][1][HIHO_NENREI_SUM][0] + Part_Fuka[shubetu][1][HIHO_NENREI_SUM][1] ) / 2.
					 * ( 16 - 10 ) / 12.;
				}
				else if( ( Option2 == 1 || Option2 == 2 ) && nendo == 2024 )
				{
					Hiho_Kei[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					 = ( Hiho_Kei[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM] + Hiho_Kei[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					   + Part_Taishou[shubetu][2][HIHO_NENREI_SUM][1] ) / 2.
					 - ( Part_Taishou[shubetu][2][HIHO_NENREI_SUM][0] + Part_Taishou[shubetu][2][HIHO_NENREI_SUM][1] ) / 2.
					 * ( 16 - 4 ) / 12.;
					Hiho_Noufu[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					 = ( Hiho_Noufu_P[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM] + Hiho_Noufu[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					   + Part_Noufu[shubetu][2][HIHO_NENREI_SUM][1] ) / 2.
					 - ( Part_Noufu[shubetu][2][HIHO_NENREI_SUM][0] + Part_Noufu[shubetu][2][HIHO_NENREI_SUM][1] ) / 2.
					 * ( 16 - 4 ) / 12.;
					for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
					{
						Hiho_Menjo[shubetu][sotai_nendo][HIHO_NENREI_SUM][dankai]
						 = ( Hiho_Menjo_P[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM][dankai]
						   + Hiho_Menjo[shubetu][sotai_nendo][HIHO_NENREI_SUM][dankai] + Part_Menjo[shubetu][2][HIHO_NENREI_SUM][dankai][1] ) / 2.
						 - ( Part_Menjo[shubetu][2][HIHO_NENREI_SUM][dankai][0] + Part_Menjo[shubetu][2][HIHO_NENREI_SUM][dankai][1] ) / 2.
						 * ( 16 - 4 ) / 12.;
					}
					Fuka_Hiho[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					 = ( Fuka_Hiho_P[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM] + Fuka_Hiho[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					   + Part_Fuka[shubetu][2][HIHO_NENREI_SUM][1] ) / 2.
					 - ( Part_Fuka[shubetu][2][HIHO_NENREI_SUM][0] + Part_Fuka[shubetu][2][HIHO_NENREI_SUM][1] ) / 2.
					 * ( 16 - 4 ) / 12.;
				}
				else
				{
					Hiho_Kei[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					 = ( Hiho_Kei[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM] + Hiho_Kei[shubetu][sotai_nendo][HIHO_NENREI_SUM] ) / 2.;
					Hiho_Noufu[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					 = ( Hiho_Noufu_P[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM] + Hiho_Noufu[shubetu][sotai_nendo][HIHO_NENREI_SUM] ) / 2.;
					for( dankai = 0 ; dankai <= MAX_MENJO - 1 ; dankai++ )
					{
						Hiho_Menjo[shubetu][sotai_nendo][HIHO_NENREI_SUM][dankai]
						 = ( Hiho_Menjo_P[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM][dankai]
						   + Hiho_Menjo[shubetu][sotai_nendo][HIHO_NENREI_SUM][dankai] ) / 2.;
					}
					Fuka_Hiho[shubetu][sotai_nendo][HIHO_NENREI_SUM]
					 = ( Fuka_Hiho_P[shubetu][sotai_nendo - 1][HIHO_NENREI_SUM] + Fuka_Hiho[shubetu][sotai_nendo][HIHO_NENREI_SUM] ) / 2.;
				}
			}
			for( nendo = SHONENDO + 1 ; nendo <= SAISHUNENDO ; nendo++ )
			{
				sotai_nendo = nendo - SHONENDO;
				// 老齢年金
				for( jukyu_nenrei = MIN_ROREI_JUKYU ; jukyu_nenrei <= 70 ; jukyu_nenrei++ )
				{
					for( nenrei = UNDER_63 ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
					{
						// 年度末給付費
						Rorei[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM]
						 = add( Rorei[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM]
						      , Rorei[shubetu][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU] );
						
						Rorei_Kyu[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM]
						 = add( Rorei_Kyu[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM]
						      , Rorei_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU] );
						
						Turo_Kyu[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM]
						 = add( Turo_Kyu[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM]
						      , Turo_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU] );
						
						Gonen[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM]
						 = add( Gonen[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM]
						      , Gonen[shubetu][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU] );
						
						// 種別計
						Rorei[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM]
						 = add( Rorei[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM]
						      , Rorei[shubetu][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU] );
						
						Rorei_Kyu[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM]
						 = add( Rorei_Kyu[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM]
						      , Rorei_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU] );
						
						Turo_Kyu[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM]
						 = add( Turo_Kyu[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM]
						      , Turo_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU] );
						
						Gonen[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM]
						 = add( Gonen[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM]
						      , Gonen[shubetu][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU] );
					}
				}
				
				// 障害年金
				for( nenrei = UNDER_63 ; nenrei <= MAX_SHOGAI_JUKYU ; nenrei++ )
				{
					// 年度末給付費
					Shogai_Ippan[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM]
					 = add( Shogai_Ippan[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM]
					      , Shogai_Ippan[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
					
					Shogai_20mae[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM]
					 = add( Shogai_20mae[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM]
					      , Shogai_20mae[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
					
					Shogai_Kyu[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM]
					 = add( Shogai_Kyu[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM]
					      , Shogai_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
					
					// 種別計
					Shogai_Ippan[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					 = add( Shogai_Ippan[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					      , Shogai_Ippan[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
					
					Shogai_20mae[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					 = add( Shogai_20mae[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					      , Shogai_20mae[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
					
					Shogai_Kyu[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					 = add( Shogai_Kyu[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					      , Shogai_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
				}
				
				// 遺族年金（妻）
				for( nenrei = UNDER_63 ; nenrei <= MAX_IZOKU_TUMA_JUKYU ; nenrei++ )
				{
					// 年度末給付費
					Izoku_Tuma[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM]
					 = add( Izoku_Tuma[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM]
					      , Izoku_Tuma[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
					
					// 種別計
					Izoku_Tuma[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					 = add( Izoku_Tuma[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					      , Izoku_Tuma[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
				}
				
				// 遺族年金（夫）
				for( nenrei = UNDER_63 ; nenrei <= MAX_IZOKU_OTTO_JUKYU ; nenrei++ )
				{
					// 年度末給付費
					Izoku_Otto[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM]
					 = add( Izoku_Otto[Hanbetu( shubetu )][sotai_nendo][nenrei - NENREI_SUM]
					      , Izoku_Otto[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
					
					// 種別計
					Izoku_Otto[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					 = add( Izoku_Otto[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					      , Izoku_Otto[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
				}
				
				// 遺族年金（子）
				// 年度末給付費
				Izoku_Ko[Hanbetu( shubetu )][sotai_nendo]
				 = add( Izoku_Ko[Hanbetu( shubetu )][sotai_nendo] , Izoku_Ko[shubetu][sotai_nendo] );
				
				// 種別計
				Izoku_Ko[SHUBETU_SUM][sotai_nendo]
				 = add( Izoku_Ko[SHUBETU_SUM][sotai_nendo] , Izoku_Ko[shubetu][sotai_nendo] );
				
				// 寡婦年金
				// 種別計
				Kafu[SHUBETU_SUM][sotai_nendo] = add( Kafu[SHUBETU_SUM][sotai_nendo] , Kafu[shubetu][sotai_nendo] );
				Kafu_Kyu[SHUBETU_SUM][sotai_nendo] = add( Kafu_Kyu[SHUBETU_SUM][sotai_nendo] , Kafu_Kyu[shubetu][sotai_nendo] );
				
				// 死亡一時金
				for( nenrei = UNDER_63 ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
				{
					// 種別計
					Ichijikin[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					 = add( Ichijikin[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM]
					      , Ichijikin[shubetu][sotai_nendo][nenrei - NENREI_SUM] );
				}
			}
		}
	}
	
	// 受給者数（年度間値）
	for( shubetu = 0 ; shubetu <= 1 ; shubetu++ )
	{
		for( nendo = SAISHUNENDO ; nendo >= SHONENDO + 2 ; nendo-- )
		{
			sotai_nendo = nendo - SHONENDO;
			for( nenrei = UNDER_64 ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
			{
				if ( nenrei == UNDER_64 )
				{
					for ( counter = 0 ; counter <= 1 ; counter++ )
					{
						for( jukyu_nenrei = MIN_ROREI_JUKYU ; jukyu_nenrei <= 70 ; jukyu_nenrei++)
						{
							Rorei_Jukyu_Nendokan[shubetu][sotai_nendo][counter]
							 += ( Rorei[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Rorei[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
								  + Rorei[shubetu * 3 + 2][sotai_nendo][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Rorei[shubetu * 3 + 3][sotai_nendo][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Rorei[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Rorei[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu ) / 2.;
							
							Rorei_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][counter]
							 += ( Rorei_Kyu[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Rorei_Kyu[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Rorei_Kyu[shubetu * 3 + 2][sotai_nendo][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Rorei_Kyu[shubetu * 3 + 3][sotai_nendo][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Rorei_Kyu[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Rorei_Kyu[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu ) / 2.;
							
							Turo_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][counter]
							 += ( Turo_Kyu[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Turo_Kyu[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Turo_Kyu[shubetu * 3 + 2][sotai_nendo][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Turo_Kyu[shubetu * 3 + 3][sotai_nendo][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
								  + Turo_Kyu[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Turo_Kyu[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu ) / 2.;
							
							Gonen_Jukyu_Nendokan[shubetu][sotai_nendo][counter]
							 += ( Gonen[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Gonen[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
								  + Gonen[shubetu * 3 + 2][sotai_nendo][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Gonen[shubetu * 3 + 3][sotai_nendo][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
								  + Gonen[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							    + Gonen[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu ) / 2.;
						}
						Shogai_Ippan_Jukyu_Nendokan[shubetu][sotai_nendo][counter]
						 += ( Shogai_Ippan[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM].ninzu
						    + Shogai_Ippan[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM].ninzu
							  + Shogai_Ippan[shubetu * 3 + 2][sotai_nendo][nenrei - 1 - NENREI_SUM].ninzu
						    + Shogai_Ippan[shubetu * 3 + 3][sotai_nendo][nenrei - 1 - NENREI_SUM].ninzu
							  + Shogai_Ippan[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu
						    + Shogai_Ippan[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu ) / 2.;
						
						Shogai_20mae_Jukyu_Nendokan[shubetu][sotai_nendo][counter]
						 += ( Shogai_20mae[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM].ninzu
						    + Shogai_20mae[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM].ninzu
							  + Shogai_20mae[shubetu * 3 + 2][sotai_nendo][nenrei - 1 - NENREI_SUM].ninzu
						    + Shogai_20mae[shubetu * 3 + 3][sotai_nendo][nenrei - 1 - NENREI_SUM].ninzu
							  + Shogai_20mae[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu
						    + Shogai_20mae[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu ) / 2.;
						
						Shogai_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][counter]
						 += ( Shogai_Kyu[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM].ninzu
						    + Shogai_Kyu[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM].ninzu
							  + Shogai_Kyu[shubetu * 3 + 2][sotai_nendo][nenrei - 1 - NENREI_SUM].ninzu
						    + Shogai_Kyu[shubetu * 3 + 3][sotai_nendo][nenrei - 1 - NENREI_SUM].ninzu
							  + Shogai_Kyu[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu
						    + Shogai_Kyu[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu ) / 2.;
						
						Izoku_Tuma_Jukyu_Nendokan[shubetu][sotai_nendo][counter]
						 += ( Izoku_Tuma[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM].ninzu
						    + Izoku_Tuma[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM].ninzu
							  + Izoku_Tuma[shubetu * 3 + 2][sotai_nendo][nenrei - 1 - NENREI_SUM].ninzu
						    + Izoku_Tuma[shubetu * 3 + 3][sotai_nendo][nenrei - 1 - NENREI_SUM].ninzu
							  + Izoku_Tuma[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu
						    + Izoku_Tuma[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu ) / 2.;
						
						if( nendo >= 2014 )
						{
							Izoku_Otto_Jukyu_Nendokan[shubetu][sotai_nendo][counter]
							 += ( Izoku_Otto[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM].ninzu
							    + Izoku_Otto[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM].ninzu
							    + Izoku_Otto[shubetu * 3 + 2][sotai_nendo][nenrei - 1 - NENREI_SUM].ninzu
							    + Izoku_Otto[shubetu * 3 + 3][sotai_nendo][nenrei - 1 - NENREI_SUM].ninzu
								  + Izoku_Otto[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu
							    + Izoku_Otto[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu ) / 2.;
						}
					}
					Izoku_Ko_Jukyu_Nendokan[shubetu][sotai_nendo]
					 += ( Izoku_Ko[shubetu * 3 + 2][sotai_nendo].ninzu
					    + Izoku_Ko[shubetu * 3 + 3][sotai_nendo].ninzu
						  + Izoku_Ko[shubetu * 3 + 2][sotai_nendo - 1].ninzu
					    + Izoku_Ko[shubetu * 3 + 3][sotai_nendo - 1].ninzu ) / 2.;
				}
				else
				{
					for( jukyu_nenrei = MIN_ROREI_JUKYU ; jukyu_nenrei <= 70 ; jukyu_nenrei++ )
					{
						Rorei_Jukyu_Nendokan[shubetu][sotai_nendo][0]
						 += ( Rorei[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
						    + Rorei[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							  + Rorei[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
						    + Rorei[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu ) / 2.;
						
						Rorei_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][0]
						 += ( Rorei_Kyu[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
						    + Rorei_Kyu[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							  + Rorei_Kyu[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
						    + Rorei_Kyu[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu ) / 2.;
						
						Turo_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][0]
						 += ( Turo_Kyu[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
						    + Turo_Kyu[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							  + Turo_Kyu[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
						    + Turo_Kyu[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu ) / 2.;
						
						Gonen_Jukyu_Nendokan[shubetu][sotai_nendo][0]
						 += ( Gonen[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
						    + Gonen[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
							  + Gonen[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu
						    + Gonen[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM][jukyu_nenrei - MIN_ROREI_JUKYU].ninzu ) / 2.;
					}
					Shogai_Ippan_Jukyu_Nendokan[shubetu][sotai_nendo][0]
					 += ( Shogai_Ippan[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM].ninzu
					    + Shogai_Ippan[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM].ninzu
						  + Shogai_Ippan[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu
					    + Shogai_Ippan[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu ) / 2.;
					
					Shogai_20mae_Jukyu_Nendokan[shubetu][sotai_nendo][0]
					 += ( Shogai_20mae[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM].ninzu
					    + Shogai_20mae[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM].ninzu
						  + Shogai_20mae[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu
					    + Shogai_20mae[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu ) / 2.;
					
					Shogai_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][0]
					 += ( Shogai_Kyu[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM].ninzu
					    + Shogai_Kyu[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM].ninzu
						  + Shogai_Kyu[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu
					    + Shogai_Kyu[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu ) / 2.;
					
					Izoku_Tuma_Jukyu_Nendokan[shubetu][sotai_nendo][0]
					 += ( Izoku_Tuma[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM].ninzu
					    + Izoku_Tuma[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM].ninzu
						  + Izoku_Tuma[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu
					    + Izoku_Tuma[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu ) / 2.;
					
					if( nendo >= 2014 )
					{
						Izoku_Otto_Jukyu_Nendokan[shubetu][sotai_nendo][0]
						 += ( Izoku_Otto[shubetu * 3 + 2][sotai_nendo][nenrei - NENREI_SUM].ninzu
						    + Izoku_Otto[shubetu * 3 + 3][sotai_nendo][nenrei - NENREI_SUM].ninzu
							  + Izoku_Otto[shubetu * 3 + 2][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu
						    + Izoku_Otto[shubetu * 3 + 3][sotai_nendo - 1][nenrei - 1 - NENREI_SUM].ninzu ) / 2.;
					}
				}
			}
		}
	}
	
	// 試算内容の作成
	sprintf( Shisan_Naiyou , "\0" );
	sprintf( NaiyouSaibou , "Kisai_Shitasasae , %f\n" , Kisai_Shitasasae );
	strcat( Shisan_Naiyou , NaiyouSaibou );
	sprintf( NaiyouSaibou , "HenkouSeinendo , %d\n" , HenkouSeinendo );
	strcat( Shisan_Naiyou , NaiyouSaibou );
	
	// 基礎年金ファイルへ出力
	write_BeginData( Version , Shisan_Naiyou , fp_kisonenkin );
	
	for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
	{
		sotai_nendo = nendo - SHONENDO;
		
		// 第１ブロック  基礎年金給付費
		for( nenrei = UNDER_63 ; nenrei <= MAX_ROREI_JUKYU ; nenrei++ )
		{
			// 老齢基礎年金
			for( shubetu = SHUBETU_OTOKO ; shubetu <= SHUBETU_ONNA ; shubetu++ )
			{
				fprintf( fp_kisonenkin , "%d,%d,%d,%d,%d,%d," , nendo , 1 , nenrei , 1 , 1 , shubetu - 6 );
				// 老齢基礎年金
				OutputValue =	Rorei[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].noufu;
				fprintf( fp_kisonenkin , "%20.14le,", OutputValue );
				
				// 老齢基礎年金（免除分）
				OutputValue = Rorei[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].menjo[SUM][1]
				               + Rorei[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].rofuku_shitasasae;
				fprintf( fp_kisonenkin , "%20.14le,", OutputValue );
				
				OutputValue = Rorei[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].menjo[SUM][2];
				fprintf( fp_kisonenkin , "%20.14le,", OutputValue );
				
				// 振替加算
				OutputValue = 0.;
				fprintf( fp_kisonenkin , "%20.14le\n", OutputValue );
			}
			
			// 障害基礎年金
			for( shubetu = SHUBETU_OTOKO ; shubetu <= SHUBETU_ONNA ; shubetu++ )
			{
				fprintf( fp_kisonenkin , "%d,%d,%d,%d,%d,%d," , nendo , 1 , nenrei , 1 , 2 , shubetu - 6 );
				// 一般・基本
				OutputValue = Shogai_Ippan[shubetu][sotai_nendo][nenrei - NENREI_SUM].kihon;
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
				
				// 一般・加給
				OutputValue = Shogai_Ippan[shubetu][sotai_nendo][nenrei - NENREI_SUM].kakyu;
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
				
				// 振替加算
				OutputValue = 0.;
				fprintf( fp_kisonenkin , "%20.14le,", OutputValue );
				
				// ２０歳前・基本
				OutputValue = Shogai_20mae[shubetu][sotai_nendo][nenrei - NENREI_SUM].kihon;
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
				
				// ２０歳前・加給
				OutputValue = Shogai_20mae[shubetu][sotai_nendo][nenrei - NENREI_SUM].kakyu;
				fprintf( fp_kisonenkin , "%20.14le\n" , OutputValue );
			}
			
			// 遺族基礎年金
			for( shubetu = SHUBETU_OTOKO ; shubetu <= SHUBETU_ONNA ; shubetu++ )
			{
				fprintf( fp_kisonenkin , "%d,%d,%d,%d,%d,%d," , nendo , 1 , nenrei , 1 , 3 , shubetu - 6 );
				// 基本
				OutputValue = Izoku_Tuma[shubetu][sotai_nendo][nenrei - NENREI_SUM].kihon
										+ Izoku_Otto[shubetu][sotai_nendo][nenrei - NENREI_SUM].kihon
				            + ( nenrei == UNDER_63 ? Izoku_Ko[shubetu][sotai_nendo].kihon : 0. );
				fprintf( fp_kisonenkin , "%20.14le,", OutputValue );
				
				// 加給
				OutputValue = Izoku_Tuma[shubetu][sotai_nendo][nenrei - NENREI_SUM].kakyu
										+ Izoku_Otto[shubetu][sotai_nendo][nenrei - NENREI_SUM].kakyu
				            + ( nenrei == UNDER_63 ? Izoku_Ko[shubetu][sotai_nendo].kakyu : 0. );
				fprintf( fp_kisonenkin , "%20.14le\n", OutputValue );	
			}
			
			// 旧法老齢・通老年金
			for( shubetu = SHUBETU_OTOKO ; shubetu <= SHUBETU_ONNA ; shubetu++ )
			{
				fprintf( fp_kisonenkin , "%d,%d,%d,%d,%d,%d," , nendo , 1 , nenrei , 2 , 1 , shubetu - 6 );
				// 納付分
				OutputValue = Rorei_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].noufu
				            + Turo_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].noufu;
				fprintf( fp_kisonenkin , "%20.14le,", OutputValue );
				
				// 免除分
				OutputValue = Rorei_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].menjo
				            + Turo_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].menjo;
				fprintf( fp_kisonenkin , "%20.14le,", OutputValue );
				
				// 嵩上げ・納付分
				OutputValue = Rorei_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].kasa_noufu
				            + Turo_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].kasa_noufu;
				fprintf( fp_kisonenkin , "%20.14le,", OutputValue );
				
				// 嵩上げ・免除分
				OutputValue =	Rorei_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].kasa_menjo
				            + Turo_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].kasa_menjo;
				fprintf( fp_kisonenkin , "%20.14le,", OutputValue );
				
				// 老福下支え
				OutputValue = Rorei_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].rofuku_shitasasae
				            + Turo_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].rofuku_shitasasae;
				fprintf( fp_kisonenkin , "%20.14le,", OutputValue );
				
				// ５年年金
				OutputValue = Gonen[shubetu][sotai_nendo][nenrei - NENREI_SUM][KURI_AGE_SAGE_SUM].noufu;
				fprintf( fp_kisonenkin , "%20.14le\n", OutputValue );
			}
			
			// 旧法障害年金
			for( shubetu = SHUBETU_OTOKO ; shubetu <= SHUBETU_ONNA ; shubetu++ )
			{
				fprintf( fp_kisonenkin , "%d,%d,%d,%d,%d,%d," , nendo , 1 , nenrei , 2 , 2 , shubetu - 6 );
				// 基本・納付分
				OutputValue = Shogai_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM].kihon
				            - Shogai_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM].menjo_kihon;
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
				
				// 基本・免除分
				OutputValue = Shogai_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM].menjo_kihon;
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
				
				// 加給・納付分
				OutputValue = Shogai_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM].kakyu
				            - Shogai_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM].menjo_kakyu;
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
				
				// 加給・免除分
				OutputValue = Shogai_Kyu[shubetu][sotai_nendo][nenrei - NENREI_SUM].menjo_kakyu;
				fprintf( fp_kisonenkin , "%20.14le\n" , OutputValue );
			}
			
			// 旧法遺族年金
			for( shubetu = SHUBETU_OTOKO ; shubetu <= SHUBETU_ONNA ; shubetu++ )
			{
				fprintf( fp_kisonenkin , "%d,%d,%d,%d,%d,%d," , nendo , 1 , nenrei , 2 , 3 , shubetu - 6 );
				// 基本・納付分
				OutputValue = 0.;
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
				
				// 基本・免除分
				OutputValue = 0.;
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
				
				// 加給・納付分
				OutputValue = 0.;
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
				
				// 加給・免除分
				OutputValue = 0.;
				fprintf( fp_kisonenkin , "%20.14le\n" , OutputValue );
			}
		}
		
		// 第２ブロック  拠出金算定対象者数
		fprintf( fp_kisonenkin , "%d," , nendo );
		OutputValue = Hiho_Noufu[2][sotai_nendo][HIHO_NENREI_SUM];
		for( dankai = 1 ; dankai <= MAX_MENJO - 1 ; dankai++ )
		{
			OutputValue += Hiho_Menjo[2][sotai_nendo][HIHO_NENREI_SUM][dankai] * Hokenryou_Wariai[dankai];
		}
		fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
		
		OutputValue = Hiho_Noufu[5][sotai_nendo][HIHO_NENREI_SUM];
		for( dankai = 1 ; dankai <= MAX_MENJO - 1 ; dankai++ )
		{
			OutputValue += Hiho_Menjo[5][sotai_nendo][HIHO_NENREI_SUM][dankai] * Hokenryou_Wariai[dankai];
		}
		fprintf( fp_kisonenkin , "%20.14le\n" , OutputValue );
		
		// 第３ブロック  受給者数
		// 老齢年金
		for( shubetu = 0 ; shubetu <= 1 ; shubetu++ )
		{
			fprintf( fp_kisonenkin , "%d,%d,%d,%d," , nendo , 2 , 1 , shubetu + 1 );
			// 新法老齢相当
			for( counter = 0 ; counter <= 1 ; counter++ )
			{
				OutputValue = Rorei_Jukyu_Nendokan[shubetu][sotai_nendo][counter];
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
			}
			// 新法通老相当
			for( counter = 0 ; counter <= 1 ; counter++ )
			{
				OutputValue = 0.;
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
			}
			// 旧法老齢相当
			for( counter = 0 ; counter <= 1 ; counter++ )
			{
				OutputValue = Rorei_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][counter];
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
			}
			// 旧法通老相当
			for( counter = 0 ; counter <= 1 ; counter++ )
			{
				OutputValue = Turo_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][counter];
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
			}
			// ５年年金
			OutputValue = Gonen_Jukyu_Nendokan[shubetu][sotai_nendo][0];
			fprintf( fp_kisonenkin , "%20.14le\n" , OutputValue );
		}
		
		// 障害年金
		for( shubetu = 0 ; shubetu <= 1 ; shubetu++ )
		{
			fprintf( fp_kisonenkin , "%d,%d,%d,%d," , nendo , 2 , 2 , shubetu + 1 );
			// 新法
			for( counter = 0 ; counter <= 1 ; counter++ )
			{
				OutputValue = Shogai_Ippan_Jukyu_Nendokan[shubetu][sotai_nendo][counter]
			              + Shogai_20mae_Jukyu_Nendokan[shubetu][sotai_nendo][counter];
				fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
			}
			// 旧法
			OutputValue = Shogai_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][0];
			fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
			
			OutputValue = Shogai_Kyu_Jukyu_Nendokan[shubetu][sotai_nendo][1];
			fprintf( fp_kisonenkin , "%20.14le\n" , OutputValue );
		}
		
		// 遺族年金
		fprintf( fp_kisonenkin , "%d,%d,%d,%d," , nendo , 2 , 3 , 1 );
		OutputValue = ( Izoku_Ko_Jukyu_Nendokan[0][sotai_nendo] + Izoku_Ko_Jukyu_Nendokan[1][sotai_nendo] ) / 2.;
		fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
		OutputValue = ( Izoku_Ko_Jukyu_Nendokan[0][sotai_nendo] + Izoku_Ko_Jukyu_Nendokan[1][sotai_nendo] ) / 2.;
		fprintf( fp_kisonenkin , "%20.14le\n" , OutputValue );
		
		fprintf( fp_kisonenkin , "%d,%d,%d,%d," , nendo , 2 , 3 , 2 );
		OutputValue = Izoku_Tuma_Jukyu_Nendokan[0][sotai_nendo][0] + Izoku_Tuma_Jukyu_Nendokan[1][sotai_nendo][0]
								+ Izoku_Otto_Jukyu_Nendokan[0][sotai_nendo][0] + Izoku_Otto_Jukyu_Nendokan[1][sotai_nendo][0]
		            + ( Izoku_Ko_Jukyu_Nendokan[0][sotai_nendo] + Izoku_Ko_Jukyu_Nendokan[1][sotai_nendo] ) / 2.;
		fprintf( fp_kisonenkin , "%20.14le," , OutputValue );
		OutputValue = Izoku_Tuma_Jukyu_Nendokan[0][sotai_nendo][1] + Izoku_Tuma_Jukyu_Nendokan[1][sotai_nendo][1]
								+ Izoku_Otto_Jukyu_Nendokan[0][sotai_nendo][1] + Izoku_Otto_Jukyu_Nendokan[1][sotai_nendo][1]
		            + ( Izoku_Ko_Jukyu_Nendokan[0][sotai_nendo] + Izoku_Ko_Jukyu_Nendokan[1][sotai_nendo] ) / 2.;
		fprintf( fp_kisonenkin , "%20.14le\n" , OutputValue );
	}
	
	// 独自給付ファイルへ出力
	write_BeginData( Version , Shisan_Naiyou , fp_dokuzi );
	for( nendo = SHONENDO ; nendo <= 2110 ; nendo++ )
	{
		sotai_nendo = nendo - SHONENDO;
		
		fprintf( fp_dokuzi , "%d,", nendo );
		
		// 付加年金納付者数
		OutputValue = Fuka_Hiho[2][sotai_nendo][HIHO_NENREI_SUM] + Fuka_Hiho[5][sotai_nendo][HIHO_NENREI_SUM];
		fprintf( fp_dokuzi , "%20.14le,", OutputValue );
		
		// 付加年金総額（新法）
		OutputValue = Rorei[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM].fuka;
		fprintf( fp_dokuzi , "%20.14le,", OutputValue );
		
		// 付加年金総額（旧法老齢）
		OutputValue = Rorei_Kyu[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM].fuka;
		fprintf( fp_dokuzi , "%20.14le,", OutputValue );
		
		// 付加年金総額（旧法通老）
		OutputValue = Turo_Kyu[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM][KURI_AGE_SAGE_SUM].fuka;
		fprintf( fp_dokuzi , "%20.14le,", OutputValue );
		
		// 寡婦年金（新法）
		OutputValue = Kafu[SHUBETU_SUM][sotai_nendo].noufu + Kafu[SHUBETU_SUM][sotai_nendo].menjo[SUM][SUM];
		fprintf( fp_dokuzi , "%20.14le,", OutputValue );
		
		// 寡婦年金（旧法・納付分）
		OutputValue = Kafu_Kyu[SHUBETU_SUM][sotai_nendo].noufu;
		fprintf( fp_dokuzi , "%20.14le,", OutputValue );
		
		// 寡婦年金（旧法・特別国庫分）
		OutputValue = Kafu_Kyu[SHUBETU_SUM][sotai_nendo].menjo[SUM][SUM];
		fprintf( fp_dokuzi , "%20.14le,", OutputValue );
		
		// 死亡一時金（本来分）
		OutputValue = Ichijikin[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM].kyufu;
		fprintf( fp_dokuzi , "%20.14le,", OutputValue );
		
		// 死亡一時金（付加年金分）
		OutputValue = Ichijikin[SHUBETU_SUM][sotai_nendo][NENREI_SUM - NENREI_SUM].kyufu_fuka;
		fprintf( fp_dokuzi , "%20.14le\n", OutputValue );
	}
}


int Hanbetu( int shubetu )
{
	int danjo;
	
	danjo = (shubetu <= 3) ? SHUBETU_OTOKO : SHUBETU_ONNA;
	return( danjo );
}
