/***************************************
*                                      *
*             納付率の作成             *
*                                      *
*                                      *
***************************************/

#include <iostream>
#include <cstdlib>
#include "snaps.h"
#include "cntl.h"
#include "file_open.h"
#include "kisosu.h"
#include "kisoritu.h"

void noufuritu( int shubetu )
{
	// 変数宣言
	int menjo_kubun;
	int menjo_jokyo;
	int nendo;
	int nenrei;
	int data_number;
	int counter;
	double buffer[BUFFER_MAX];
	double Noufuritu_Mokuhyo[SAISHUNENDO - SHONENDO + 1];
	double Noufuritu_Ashimoto[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Noufuritu_Kennin[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Noufuritu_Hiho[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Menjosha_Ashimoto[NENDO_JISSEKI - SHONENDO + 1][MENJO_JOKYO];
	double Menjosha[MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MENJO_JOKYO];
	double Menjoritu_Mokuhyo[SAISHUNENDO - SHONENDO + 1][MENJO_JOKYO];
	double Menjoritu_Ashimoto[MENJO_JOKYO];
	double Menjoritu[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MENJO_JOKYO];
	double Menjo_Hikiage[MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MENJO_JOKYO];
	double Menjo_Hikiage_Sum[MENJO_JOKYO];
	double Tuinouritu_Ashimoto[SAISHUNENDO - SHONENDO + 1][11][MENJO_JOKYO];
	double Tuinouritu_Kyufu[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MENJO_JOKYO];
	double Tuinouritu_Santei[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MENJO_JOKYO];
	double Kanendo_Noufuritu_Ashimoto[SAISHUNENDO - SHONENDO + 1][3][MAX_MENJO];
	double Kanendo_Noufuritu_Kyufu[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Kanendo_Noufuritu_Santei[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Tokureiritu_Gakusei_S[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1];
	double Tokureiritu_Wakamono_S[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1];
 	double Sotowaku_Seibetu[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1];
 	double Sotowaku_Nenrei[MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1];
	double Sotowaku_Kei[SAISHUNENDO - SHONENDO + 1];
	double Hiho_Kennin[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Hiho_Kennin_Sum;
	double Hiho_Hikiage[MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Hiho_Hikiage_Sum;
	double Noufusha_Kennin[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Hikiageritu;
	double Hosei;
	double Noufusha_Sum[SAISHUNENDO - SHONENDO + 1][MAX_MENJO];
	double Hihokensha_Sum[SAISHUNENDO - SHONENDO + 1][MAX_MENJO];
	double Noufuritu_Kennin_Sum[SAISHUNENDO - SHONENDO + 1][MAX_MENJO];
	double Menjosha_Kei;
	double Noufuritu_Ashimoto_Jurai[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Menjoritu_Jurai[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MENJO_JOKYO];
 	double Sotowaku_Seibetu_Jurai[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1];
 	double Sotowaku_Nenrei_Jurai[MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1];
	double Sotowaku_Kei_Jurai[SAISHUNENDO - SHONENDO + 1];
	double Menjosha_Jurai[MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MENJO_JOKYO];
	double Hiho_Kennin_Jurai[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Noufuritu_Kennin_Jurai[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	double Noufusha_Kennin_Jurai[SAISHUNENDO - SHONENDO + 1][MAX_HIHO_NENREI - MIN_HIHO_NENREI + 1][MAX_MENJO];
	
	using namespace std;
	
	// ３号被保険者
	for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
	{
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			if( Option3 == 0 )
			{
				if( nenrei <= 59 )
				{
					Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 1.;
					Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 1.;
				}
				else
				{
					Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
					Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				}
			}
			if( Option3 == 1 )
			{
				if( nenrei <= 59 + encho_year( nendo ) )
				{
					Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 1.;
					Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 1.;
				}
				else
				{
					Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
					Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				}
			}
			for( menjo_kubun = SUM ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
			{
				Menjoritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
				Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
			}
		}
	}
	// １号被保険者
	if( shubetu == 2 || shubetu == 5 )
	{
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				for( menjo_kubun = SUM ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					Menjoritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Noufuritu_Ashimoto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Kanendo_Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Kanendo_Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
				}
				for( menjo_jokyo = SUM ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
				{
					Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
					Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
					Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
					Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
				}
				Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Sotowaku_Seibetu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				Sotowaku_Seibetu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
			}
			for( menjo_kubun = SUM ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
			{
				Noufusha_Sum[nendo - SHONENDO][menjo_kubun] = 0.;
				Hihokensha_Sum[nendo - SHONENDO][menjo_kubun] = 0.;
				Noufuritu_Kennin_Sum[nendo - SHONENDO][menjo_kubun] = 0.;
				for( counter = 0 ; counter <= 2 ; counter++ )
				{
					Kanendo_Noufuritu_Ashimoto[nendo - SHONENDO][counter][menjo_kubun] = 0.;
				}
			}
			for( menjo_jokyo = SUM ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
			{
				Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo] = 0.;
				for( counter = 0 ; counter <= 10 ; counter++ )
				{
					Tuinouritu_Ashimoto[nendo - SHONENDO][counter][menjo_jokyo] = 0.;
				}
			}
			Noufuritu_Mokuhyo[nendo - SHONENDO] = 0.;
			Sotowaku_Kei[nendo - SHONENDO] = 0.;
			Sotowaku_Kei_Jurai[nendo - SHONENDO] = 0.;
		}
		for( nendo = SHONENDO ; nendo <= NENDO_JISSEKI ; nendo++ )
		{
			for( menjo_jokyo = SUM ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
			{
				Menjosha_Ashimoto[nendo - SHONENDO][menjo_jokyo] = 0.;
			}
		}
		for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
		{
			for( menjo_kubun = SUM ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
			{
				Hiho_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
			}
			for( menjo_jokyo = SUM ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
			{
				Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
				Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
			}
			Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] = 0.;
			Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] = 0.;
		}
		for( menjo_jokyo = SUM ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
		{
			Menjoritu_Ashimoto[menjo_jokyo] = 0.;
		}
		// 初年度の年齢別納付率及び免除率を投入
		for( nendo = SHONENDO + 1 ; nendo <= SHONENDO + 1 ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				if( read_data( buffer , fp_noufu_menjo_wariai , &data_number ) != EOF && buffer[0] == shubetu && buffer[1] == nenrei )
				{
					for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
					{
						Noufuritu_Ashimoto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = buffer[ menjo_kubun + 1 ];
						
						if( Option3 == 1 )
						{
							Noufuritu_Ashimoto_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = buffer[ menjo_kubun + 1 ];
							Noufuritu_Ashimoto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = buffer[ menjo_kubun + 11 ];
						}
					}
					for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
					{
						Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = buffer[menjo_jokyo + 5];
						
						if( Option3 == 1 )
						{
							Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = buffer[menjo_jokyo + 5];
							Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = buffer[menjo_jokyo + 15];
						}
					}
				}
				else
				{
					cout << "年齢別免除率ファイル読込中にＥＯＦを検出しました" << endl;
					exit( 1 );
				}
			}
		}
		// 次年度以降
		for( nendo = SHONENDO + 2 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					Noufuritu_Ashimoto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 = Noufuritu_Ashimoto[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
					
					if( Option3 == 1 )
					{
						Noufuritu_Ashimoto_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 = Noufuritu_Ashimoto_Jurai[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
					}
				}
				for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
				{
					Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
					 = Menjoritu[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
					
					if( Option3 == 1 )
					{
						Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
						 = Menjoritu_Jurai[SHONENDO + 1 - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
					}
				}
			}
		}
		// 各年度の納付率等
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			if( read_data( buffer , fp_mokuhyounoufu , &data_number ) != EOF && buffer[0] == nendo )
			{
				Noufuritu_Mokuhyo[nendo - SHONENDO] = buffer[1];
				
				// （オプションⅡ関係）更なる適用拡大による納付率上昇
				if( Option2 == 1 )
				{
					if( nendo == 2024 )
					{
						Noufuritu_Mokuhyo[nendo - SHONENDO] += 0.003;
					}
					else if( nendo > 2024 )
					{
						Noufuritu_Mokuhyo[nendo - SHONENDO] += 0.003;
					}
				}
				if( Option2 == 2 )
				{
					if( nendo == 2024 )
					{
						Noufuritu_Mokuhyo[nendo - SHONENDO] += 0.030;
					}
					else if( nendo > 2024 )
					{
						Noufuritu_Mokuhyo[nendo - SHONENDO] += 0.033;
					}
				}
				
				for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
				{
					Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo] = buffer[menjo_jokyo + 1];
				}
				
				// 追納率
				for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
				{
					for( counter = 0 ; counter <= 1 ; counter++ )
					{
						Tuinouritu_Ashimoto[nendo - SHONENDO][counter][menjo_jokyo] = buffer[( menjo_jokyo - 1 ) * 2 + counter + 8];
					}
					for( counter = 2 ; counter <= 10 ; counter++ )
					{
						Tuinouritu_Ashimoto[nendo - SHONENDO][counter][menjo_jokyo] = Tuinouritu_Ashimoto[nendo - SHONENDO][1][menjo_jokyo];
					}
				}
				
				// 過年度納付率
				for( menjo_kubun = ZENGAKU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					for( counter = 1 ; counter <= 2 ; counter++ )
					{
						Kanendo_Noufuritu_Ashimoto[nendo - SHONENDO][counter][menjo_kubun] = buffer[( menjo_kubun - 1 ) * 2 + counter + 19];
					}
					
					Kanendo_Noufuritu_Ashimoto[nendo - SHONENDO][0][menjo_kubun]
					 = Kanendo_Noufuritu_Ashimoto[nendo - SHONENDO][1][menjo_kubun] + Kanendo_Noufuritu_Ashimoto[nendo - SHONENDO][2][menjo_kubun];
				}
			}
			else
			{
				cout << "納付率前提ファイルの第一ブロック読込中にＥＯＦを検出しました" << endl;
				exit( 1 );
			}
		}
		// 足下の免除者数
		for( nendo = SHONENDO + 1 ; nendo <= NENDO_JISSEKI ; nendo++ )
		{
			if( read_data( buffer , fp_mokuhyounoufu , &data_number ) != EOF && buffer[0] == nendo )
			{
				for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
				{
					Menjosha_Ashimoto[nendo - SHONENDO][menjo_jokyo] = buffer[menjo_jokyo];
				}
			}
			else
			{
				cout << "納付率前提ファイルの第二ブロック読込中にＥＯＦを検出しました" << endl;
				exit( 1 );
			}
		}
		
		
		for( nendo = SHONENDO + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			// 年度別・年齢別の納付率、免除率等の作成
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				Sotowaku_Seibetu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 = Sotowaku[shubetu][nendo - SOTOWAKU_SHONENDO][nenrei - MIN_HIHO_NENREI];
				
				Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI]
				 = Sotowaku[2][nendo - SOTOWAKU_SHONENDO][nenrei - MIN_HIHO_NENREI]
				  + Sotowaku[5][nendo - SOTOWAKU_SHONENDO][nenrei - MIN_HIHO_NENREI];
				
				Sotowaku_Kei[nendo - SHONENDO] += Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI];
				
				if( Option3 == 1 )
				{
					Sotowaku_Seibetu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
					 = Sotowaku_Jurai[shubetu][nendo - SOTOWAKU_SHONENDO][nenrei - MIN_HIHO_NENREI];
					
					Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI]
					 = Sotowaku_Jurai[2][nendo - SOTOWAKU_SHONENDO][nenrei - MIN_HIHO_NENREI]
					  + Sotowaku_Jurai[5][nendo - SOTOWAKU_SHONENDO][nenrei - MIN_HIHO_NENREI];
					
					Sotowaku_Kei_Jurai[nendo - SHONENDO] += Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI];
				}
			}
			// 足下年度の免除率
			for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
			{
				if( nendo <= NENDO_JISSEKI )
				{
					Menjoritu_Ashimoto[menjo_jokyo] = Menjosha_Ashimoto[nendo - SHONENDO][menjo_jokyo] / Sotowaku_Kei[nendo - SHONENDO];
				}
				else
				{
					Menjoritu_Ashimoto[menjo_jokyo] = Menjosha_Ashimoto[NENDO_JISSEKI - SHONENDO][menjo_jokyo] / Sotowaku_Kei[NENDO_JISSEKI - SHONENDO];
				}
				
				if( Option3 == 1 )
				{
					if( nendo <= NENDO_JISSEKI )
					{
						Menjoritu_Ashimoto[menjo_jokyo] = Menjosha_Ashimoto[nendo - SHONENDO][menjo_jokyo] / Sotowaku_Kei_Jurai[nendo - SHONENDO];
					}
					else
					{
						Menjoritu_Ashimoto[menjo_jokyo] = Menjosha_Ashimoto[NENDO_JISSEKI - SHONENDO][menjo_jokyo] / Sotowaku_Kei_Jurai[NENDO_JISSEKI - SHONENDO];
					}
				}
			}
			// 免除率の調整
			// 学生
			Hosei = 0.;
			if( ( Option3 == 0 && Sotowaku_Kei[nendo - SHONENDO] > 0. ) || ( Option3 == 1 && Sotowaku_Kei_Jurai[nendo - SHONENDO] > 0. ) )
			{
				for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
				{
					if( Option3 == 0 )
					{
						Hosei += Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
						       / Sotowaku_Kei[nendo - SHONENDO];
					}
					if( Option3 == 1 )
					{
						Hosei += Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] * Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
						       / Sotowaku_Kei_Jurai[nendo - SHONENDO];
					}
				}
			}
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				if( nendo <= NENDO_JISSEKI )
				{
					Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI] *= Menjoritu_Ashimoto[GAKUSEI] / Hosei;
					
					if( Option3 == 1 )
					{
						Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI] *= Menjoritu_Ashimoto[GAKUSEI] / Hosei;
					}
				}
				else
				{
					if( Hosei > 0. )
					{
						Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
						 *= Menjoritu_Ashimoto[GAKUSEI] / Hosei * Menjoritu_Mokuhyo[nendo - SHONENDO][GAKUSEI] / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][GAKUSEI];
					}
					else
					{
						Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI] = 0.;
					}
					
					if( Option3 == 1 )
					{
						if( Hosei > 0. )
						{
							Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
							 *= Menjoritu_Ashimoto[GAKUSEI] / Hosei * Menjoritu_Mokuhyo[nendo - SHONENDO][GAKUSEI] / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][GAKUSEI];
						}
						else
						{
							Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI] = 0.;
						}
					}
				}
				Menjosha[nenrei - MIN_HIHO_NENREI][GAKUSEI] = Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI];
				
				if( Option3 == 1 )
				{
					Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][GAKUSEI] = Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] * Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI];
				}
			}
			
			// 下で使うデータのゼロクリア
			for( menjo_jokyo = SUM ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
			{
				Menjo_Hikiage_Sum[menjo_jokyo] = 0.;
			}
			
			// 学生以外
			// うち若者以外
			for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= MENJO_1_4 ; menjo_jokyo++ )
			{
				for( nenrei = MIN_HIHO_NENREI ; nenrei <= 59 ; nenrei++ )
				{
					Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_jokyo]
					 = Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * ( 1. - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] );
					
					if( Option3 == 1 )
					{
						Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_jokyo]
						 = Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] * ( 1. - Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] );
					}
					
					Menjo_Hikiage_Sum[menjo_jokyo] += Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_jokyo];
				}
			}
			// 若者
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= 29 ; nenrei++ )
			{
				Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][WAKAMONO]
				 = Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * ( 1. - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO] );
				
				if( Option3 == 1 )
				{
					Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][WAKAMONO]
					 = Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] * ( 1. - Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO] );
				}
				Menjo_Hikiage_Sum[WAKAMONO] += Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][WAKAMONO];
			}
			
			// 目標免除率への調整率
			for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
			{
				if( menjo_jokyo != GAKUSEI )
				{
					if( nendo <= NENDO_JISSEKI )
					{
						Hikiageritu = Sotowaku_Kei[nendo - SHONENDO] * Menjoritu_Ashimoto[menjo_jokyo];
						
						if( Option3 == 1 )
						{
							Hikiageritu = Sotowaku_Kei_Jurai[nendo - SHONENDO] * Menjoritu_Ashimoto[menjo_jokyo];
						}
					}
					else
					{
						Hikiageritu = Sotowaku_Kei[nendo - SHONENDO] * Menjoritu_Ashimoto[menjo_jokyo]
						            * Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo] / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][menjo_jokyo];
						
						if( Option3 == 1 )
						{
							Hikiageritu = Sotowaku_Kei_Jurai[nendo - SHONENDO] * Menjoritu_Ashimoto[menjo_jokyo]
							            * Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo] / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][menjo_jokyo];
						}
					}
					for( nenrei = MIN_HIHO_NENREI ; nenrei <= 59 ; nenrei++ )
					{
						if( Option3 == 0 )
						{
							Hikiageritu
							 -= Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
						}
						if( Option3 == 1 )
						{
							Hikiageritu
							 -= Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] * Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
						}
					}
					Hikiageritu /= Menjo_Hikiage_Sum[menjo_jokyo];
					
					Hosei = 0.;
					if( ( Option3 == 0 && Sotowaku_Kei[nendo - SHONENDO] > 0. ) || ( Option3 == 1 && Sotowaku_Kei_Jurai[nendo - SHONENDO] > 0. ) )
					{
						for( nenrei = MIN_HIHO_NENREI ; nenrei <= 59 ; nenrei++ )
						{
							if( Option3 == 0 )
							{
								Hosei += Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
								       / Sotowaku_Kei[nendo - SHONENDO];
							}
							if( Option3 == 1 )
							{
								Hosei += Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] * Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
								       / Sotowaku_Kei_Jurai[nendo - SHONENDO];
							}
						}
					}
					// 若者以外
					if( Hikiageritu < 0. )
					{
						if( menjo_jokyo <= MENJO_1_4 )
						{
							for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
							{
								if( nendo <= NENDO_JISSEKI )
								{
									Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] *= Menjoritu_Ashimoto[menjo_jokyo] / Hosei;
									
									if( Option3 == 1 )
									{
										Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] *= Menjoritu_Ashimoto[menjo_jokyo] / Hosei;
									}
								}
								else
								{
									if( Hosei > 0. )
									{
										Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
										  *= Menjoritu_Ashimoto[menjo_jokyo] / Hosei
										   * Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo] / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][menjo_jokyo];
									}
									else
									{
										Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
									}
									if( Option3 == 1 )
									{
										if( Hosei > 0. )
										{
											Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
											  *= Menjoritu_Ashimoto[menjo_jokyo] / Hosei
											   * Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo] / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][menjo_jokyo];
										}
										else
										{
											Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0.;
										}
									}
								}
								Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo]
								  = Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
								
								if( Option3 == 1 )
								{
									Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo]
								  	= Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] * Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
								}
							}
						}
						else
						{
							for( nenrei = MIN_HIHO_NENREI ; nenrei <= 29 ; nenrei++ )
							{
								if( nendo <= NENDO_JISSEKI )
								{
									Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] *= Menjoritu_Ashimoto[menjo_jokyo] / Hosei;
									
									if( Option3 == 1 )
									{
										Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] *= Menjoritu_Ashimoto[menjo_jokyo] / Hosei;
									}
								}
								else
								{
									if( Hosei > 0. )
									{
										Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
										  *= Menjoritu_Ashimoto[menjo_jokyo] / Hosei
										   * Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo] / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][menjo_jokyo];
									}
									else
									{
										Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0;
									}
									
									if( Option3 == 1 )
									{
										if( Hosei > 0. )
										{
											Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
											  *= Menjoritu_Ashimoto[menjo_jokyo] / Hosei
											   * Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo] / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][menjo_jokyo];
										}
										else
										{
											Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = 0;
										}
									}
								}
								Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo]
								  = Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
								
								if( Option3 == 1 )
								{
									Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo]
									  = Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] * Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
								}
							}
						}
					}
					if( Hikiageritu >= 0. )
					{
						if( menjo_jokyo <= MENJO_1_4 )
						{
							for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
							{
								Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo]
								 = Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
								 + Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_jokyo] * Hikiageritu;
								
								if( Option3 == 1 )
								{
									Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo]
									 = Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] * Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
									 + Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_jokyo] * Hikiageritu;
									
									Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
									 = Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo] / Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI];
									
									if( nenrei >= 60 )
									{
										Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo]
										 = Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
										 + Menjo_Hikiage[59 - MIN_HIHO_NENREI][menjo_jokyo] * Hikiageritu;
									}
								}
								Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
								 = Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo] / Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI];
							}
						}
						else
						{
							// 若者
							for( nenrei = MIN_HIHO_NENREI ; nenrei <= 29 ; nenrei++ )
							{
								Menjosha[nenrei - MIN_HIHO_NENREI][WAKAMONO]
								 = Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI] * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO]
								 + Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][WAKAMONO] * Hikiageritu;
								
								Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO]
								 = Menjosha[nenrei - MIN_HIHO_NENREI][WAKAMONO] / Sotowaku_Nenrei[nenrei - MIN_HIHO_NENREI];
								
								if( Option3 == 1 )
								{
									Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][WAKAMONO]
									 = Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI] * Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO]
									 + Menjo_Hikiage[nenrei - MIN_HIHO_NENREI][WAKAMONO] * Hikiageritu;
									
									Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO]
									 = Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][WAKAMONO] / Sotowaku_Nenrei_Jurai[nenrei - MIN_HIHO_NENREI];
								}
							}
						}
					}
				}
			}
			if( Option3 == 1 )
			{
				for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
				{
					for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= MENJO_1_4 ; menjo_jokyo++ )
					{
						if( nendo - nenrei == 1958 || nendo - nenrei == 1959 )
						{
							if( nenrei >= 61 )
							{
								Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
								Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo];
							}
						}
						else if( nendo - nenrei == 1960 || nendo - nenrei == 1961 )
						{
							if( nenrei >= 62 )
							{
								Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
								Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo];
							}
						}
						else if( nendo - nenrei == 1962 || nendo - nenrei == 1963 )
						{
							if( nenrei >= 63 )
							{
								Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
								Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo];
							}
						}
						else if( nendo - nenrei == 1964 || nendo - nenrei == 1965 )
						{
							if( nenrei >= 64 )
							{
								Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
								Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo];
							}
						}
						else if( nendo - nenrei >= 1966 )
						{
							if( nenrei >= 65 )
							{
								Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
								Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo];
							}
						}
						else
						{
							if( nenrei >= 60 )
							{
								Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
								Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo] = Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo];
							}
						}
					}
				}
			}
			// 目標免除率から乖離していないか確認
			for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
			{
				Menjosha_Kei = 0.;
				
				for( nenrei = MIN_HIHO_NENREI ; nenrei <= 59 ; nenrei++ )
				{
					if( Option3 == 0 )
					{
						Menjosha_Kei += Menjosha[nenrei - MIN_HIHO_NENREI][menjo_jokyo];
					}
					if( Option3 == 1 )
					{
						Menjosha_Kei += Menjosha_Jurai[nenrei - MIN_HIHO_NENREI][menjo_jokyo];
					}
				}
				if( nendo <= NENDO_JISSEKI )
				{
					if( Option3 == 0 )
						{
						if( Menjosha_Kei / Sotowaku_Kei[nendo - SHONENDO] - Menjoritu_Ashimoto[menjo_jokyo] > 1.e-14
						  || Menjoritu_Ashimoto[menjo_jokyo] - Menjosha_Kei / Sotowaku_Kei[nendo - SHONENDO] > 1.e-14 )
						{
							cout << " 種別 " << shubetu << " 、" << nendo << " 年度、免除区分 " << menjo_jokyo << " の免除率が目標免除率から乖離しています" << endl;
							cout << "目標免除率 " << Menjoritu_Ashimoto[menjo_jokyo] << " , 実際の免除率 "
							     << Menjosha_Kei / Sotowaku_Kei[nendo - SHONENDO] << endl;
							exit( 1 );
						}
					}
					if( Option3 == 1 )
						{
						if( Menjosha_Kei / Sotowaku_Kei[nendo - SHONENDO] - Menjoritu_Ashimoto[menjo_jokyo] > 1.e-14
						  || Menjoritu_Ashimoto[menjo_jokyo] - Menjosha_Kei / Sotowaku_Kei_Jurai[nendo - SHONENDO] > 1.e-14 )
						{
							cout << " 種別 " << shubetu << " 、" << nendo << " 年度、免除区分 " << menjo_jokyo << " の免除率が目標免除率から乖離しています" << endl;
							cout << "目標免除率 " << Menjoritu_Ashimoto[menjo_jokyo] << " , 実際の免除率 "
							     << Menjosha_Kei / Sotowaku_Kei_Jurai[nendo - SHONENDO] << endl;
							exit( 1 );
						}
					}
				}
				else
				{
					if( Option3 == 0 )
					{
						if( Menjosha_Kei / Sotowaku_Kei[nendo - SHONENDO] - Menjoritu_Ashimoto[menjo_jokyo] * Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo]
						     / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][menjo_jokyo] > 1.e-14
						  || Menjoritu_Ashimoto[menjo_jokyo] * Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo] / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][menjo_jokyo]
						      - Menjosha_Kei / Sotowaku_Kei[nendo - SHONENDO] > 1.e-14 )
						{
							cout << " 種別 " << shubetu << " 、" << nendo << " 年度、免除区分 " << menjo_jokyo << " の免除率が目標免除率から乖離しています" << endl;
							cout << "目標免除率 " << Menjoritu_Ashimoto[menjo_jokyo] << " , 実際の免除率 "
							     << Menjosha_Kei / Sotowaku_Kei[nendo - SHONENDO] << endl;
							exit( 1 );
						}
					}
					if( Option3 == 1 )
					{
						if( Menjosha_Kei / Sotowaku_Kei_Jurai[nendo - SHONENDO]
						     - Menjoritu_Ashimoto[menjo_jokyo] * Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo]
						       / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][menjo_jokyo] > 1.e-14
						  || Menjoritu_Ashimoto[menjo_jokyo] * Menjoritu_Mokuhyo[nendo - SHONENDO][menjo_jokyo] / Menjoritu_Mokuhyo[NENDO_JISSEKI - SHONENDO][menjo_jokyo]
						      - Menjosha_Kei / Sotowaku_Kei_Jurai[nendo - SHONENDO] > 1.e-14 )
						{
							cout << " 種別 " << shubetu << " 、" << nendo << " 年度、免除区分 " << menjo_jokyo << " の免除率が目標免除率から乖離しています" << endl;
							cout << "目標免除率 " << Menjoritu_Ashimoto[menjo_jokyo] << " , 実際の免除率 "
							     << Menjosha_Kei / Sotowaku_Kei_Jurai[nendo - SHONENDO] << endl;
							exit( 1 );
						}
					}
				}
			}
			
			// 免除率が負値となっていないか、免除率の和が１を超えていないかを確認
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
				{
					if( Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] < 0. )
					{
						cout << "年度 " << nendo << " ,年齢 " << nenrei << " ,免除区分 " << menjo_jokyo << " の免除率がマイナスとなってます" << endl;
						cout << "値は " << Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo] << endl;
						exit( 1 );
					}
					Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM] += Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
					
					if( Option3 == 1 )
					{
						Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM] += Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
					}
				}
				if( Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM] > 1. )
				{
					cout << "年度 " << nendo << " ,年齢 " << nenrei << " の免除率の計が１を上回っています" << endl;
					exit( 1 );
				}
			}
			
			Hiho_Kennin_Sum = 0.;
			Hiho_Hikiage_Sum = 0.;
			
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				// 年度別の検認対象者数
				Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
				 = Sotowaku_Seibetu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				    * ( 1. - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
				           - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
				           - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
				           - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4]
				           - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
				           - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO] );
				if( Option3 == 1 )
				{
					Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
					 = Sotowaku_Seibetu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
					    * ( 1. - Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
					           - Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
					           - Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
				  	         - Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4]
				    	       - Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
				      	     - Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO] );
				}
				for( menjo_kubun = MENJO_3_4 ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 = Sotowaku_Seibetu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
					
					if( Option3 == 1 )
					{
						Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 = Sotowaku_Seibetu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] * Menjoritu_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
					}
				}
				Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM]
				 = Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
				 + Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
				 + Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
				 + Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4];
				
				if( Option3 == 1 )
				{
					Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM]
					 = Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
					 + Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
					 + Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
					 + Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4];
				}
				// 年度、年齢、免除種別別の最大調整可能な人数を算出
				for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					Hiho_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 = Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 * ( 1. - Noufuritu_Ashimoto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] );
					
					if( Option3 == 1 )
					{
						Hiho_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 = Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 * ( 1. - Noufuritu_Ashimoto_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] );
					}
					if( nenrei <= MAX_HIHO_NENREI - 1 )
					{
						if( Option3 == 0 )
						{
							Hiho_Kennin_Sum += Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						}
						if( Option3 == 1 )
						{
							Hiho_Kennin_Sum += Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						}
						Hiho_Hikiage_Sum += Hiho_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_kubun];
					}
				}
			}
			// 前提納付率への調整率
			Hikiageritu = Hiho_Kennin_Sum * Noufuritu_Mokuhyo[nendo - SHONENDO];
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					if( nenrei <= MAX_HIHO_NENREI - 1 )
					{
						if( Option3 == 0 )
						{
							Hikiageritu -= Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
							             * Noufuritu_Ashimoto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						}
						if( Option3 == 1 )
						{
							Hikiageritu -= Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
							             * Noufuritu_Ashimoto_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						}
					}
				}
			}
			Hikiageritu /= Hiho_Hikiage_Sum;
			
			if( Hikiageritu < 0. )
			{
				Hosei = 0.;
				for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
				{
					for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
					{
						if( nenrei <= MAX_HIHO_NENREI - 1 )
						{
							if( Option3 == 0 )
							{
								Hosei += Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
											 * Noufuritu_Ashimoto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] / Hiho_Kennin_Sum;
							}
							if( Option3 == 1 )
							{
								Hosei += Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
											 * Noufuritu_Ashimoto_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] / Hiho_Kennin_Sum;
							}
						}
					}
				}
				for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
				{
					for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
					{
						Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 = Noufuritu_Ashimoto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] * Noufuritu_Mokuhyo[nendo - SHONENDO] / Hosei;
						Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 = Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] * Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM] += Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						
						if( Option3 == 1 )
						{
							Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
							 = Noufuritu_Ashimoto_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] * Noufuritu_Mokuhyo[nendo - SHONENDO] / Hosei;
							Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
							 = Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] * Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
							Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM] += Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						}
					}
					Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM]
					 = Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM] / Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM];
					
					if( Option3 == 1 )
					{
						Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM]
						 = Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM] / Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM];
					}
				}
			}
			else
			{
				for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
				{
					// 年度、年齢、免除制度別納付者数
					for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
					{
						Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 = Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 * Noufuritu_Ashimoto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 + Hiho_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_kubun] * Hikiageritu;
						if( Option3 == 1 )
						{
							if( nenrei >= 60 )
							{
								Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 * Noufuritu_Ashimoto[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 + Hiho_Hikiage[59 - MIN_HIHO_NENREI][menjo_kubun] * Hikiageritu;
							}
							Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
							 = Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
							 * Noufuritu_Ashimoto_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
							 + Hiho_Hikiage[nenrei - MIN_HIHO_NENREI][menjo_kubun] * Hikiageritu;
						}
					}
					// 年度末の年齢別の納付率の作成
					Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM]
					 = ( Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
					   + Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
					   + Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
					   + Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4] )
					 / Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM];
					
					if( Option3 == 1 )
					{
						Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM]
						 = ( Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
						   + Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
						   + Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
						   + Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4] )
						 / Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM];
					}
					for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
					{
						if( Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] == 0. )
						{
							Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
						}
						else
						{
							Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
							 = Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
							 / Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						}
						if( Option3 == 1 )
						{
							if( Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] == 0. )
							{
								Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
							}
							else
							{
								Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 / Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
							}
						}
					}
				}
			}
		}
		if( Option3 == 1 )
		{
			for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
			{
				for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
				{
					for( menjo_kubun = SUM ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
					{
						if( nendo - nenrei == 1958 || nendo - nenrei == 1959 )
						{
							if( nenrei >= 61 )
							{
								Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
							}
						}
						else if( nendo - nenrei == 1960 || nendo - nenrei == 1961 )
						{
							if( nenrei >= 62 )
							{
								Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
							}
						}
						else if( nendo - nenrei == 1962 || nendo - nenrei == 1963 )
						{
							if( nenrei >= 63 )
							{
								Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
							}
						}
						else if( nendo - nenrei == 1964 || nendo - nenrei == 1965 )
						{
							if( nenrei >= 64 )
							{
								Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
							}
						}
						else if( nendo - nenrei >= 1966 )
						{
							if( nenrei >= 65 )
							{
								Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
							}
						}
						else
						{
							if( nenrei >= 60 )
							{
								Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufuritu_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
								Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
								 = Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
							}
						}
					}
				}
			}
		}
		// 各納付率が負値となっていないか確認
		for( nendo = SHONENDO ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					if( Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] < 0. )
					{
						cout << "年度 " << nendo << " ,年齢 " << nenrei << " ,免除区分 " << menjo_kubun << " の納付率がマイナスとなってます" << endl;
						cout << "値は " << Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] << endl;
						exit( 1 );
					}
				}
			}
		}
		// 納付率チェック
		for( nendo = SHONENDO + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI ; nenrei++ )
			{
				for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					if( Option3 == 0 )
					{
						Noufusha_Sum[nendo - SHONENDO][menjo_kubun] += Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						Noufusha_Sum[nendo - SHONENDO][SUM] += Noufusha_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						Hihokensha_Sum[nendo - SHONENDO][menjo_kubun] += Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						Hihokensha_Sum[nendo - SHONENDO][SUM] += Hiho_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
					}
					if( Option3 == 1 )
					{
						Noufusha_Sum[nendo - SHONENDO][menjo_kubun] += Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						Noufusha_Sum[nendo - SHONENDO][SUM] += Noufusha_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						Hihokensha_Sum[nendo - SHONENDO][menjo_kubun] += Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
						Hihokensha_Sum[nendo - SHONENDO][SUM] += Hiho_Kennin_Jurai[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
					}
				}
			}
			for( menjo_kubun = SUM ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
			{
				Noufuritu_Kennin_Sum[nendo - SHONENDO][menjo_kubun]
				 = Noufusha_Sum[nendo - SHONENDO][menjo_kubun] / Hihokensha_Sum[nendo - SHONENDO][menjo_kubun];
			}
			// 乖離の幅が倍精度の有効桁数よりも乖離した時はストップ
			if( Noufuritu_Kennin_Sum[nendo - SHONENDO][SUM] - Noufuritu_Mokuhyo[nendo - SHONENDO] > 1.e-14
			  || Noufuritu_Mokuhyo[nendo - SHONENDO] - Noufuritu_Kennin_Sum[nendo - SHONENDO][SUM] > 1.e-14 )
			{
				cout << nendo << " 年度の納付率が前提納付率から乖離しています" << endl;
				cout << "前提納付率 " << Noufuritu_Mokuhyo[nendo - SHONENDO] << " , 実際の納付率 " << Noufuritu_Kennin_Sum[nendo - SHONENDO][SUM] << endl;
				exit(1);
			}
		}
		// 被保険者全体ベースでの納付率
		for( nendo = SHONENDO + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
				 = ( 1. - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
				        - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
				        - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
				        - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4]
				        - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
				        - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO] )
				 * Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU];
				
				for( menjo_kubun = MENJO_3_4 ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 = Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 * Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
				}
				Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][SUM]
				 = Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
				 + Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
				 + Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
				 + Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4];
			}
		}
		// 追納率の作成
		// 給付費推計用
		for( nendo = SHONENDO + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= MENJO_1_4 ; menjo_jokyo++ )
				{
					Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo]
					 = ( Tuinouritu_Ashimoto[nendo - SHONENDO][0][menjo_jokyo] + Tuinouritu_Ashimoto[nendo - SHONENDO][1][menjo_jokyo] * 10. )
					 * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
				}
				Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
				 = ( Tuinouritu_Ashimoto[nendo - SHONENDO][0][GAKUSEI] + Tuinouritu_Ashimoto[nendo - SHONENDO][1][GAKUSEI] * 10. )
			   * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI];
				
				if( nenrei <= 29 )
				{
				  Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO]
					 = ( Tuinouritu_Ashimoto[nendo - SHONENDO][0][WAKAMONO] + Tuinouritu_Ashimoto[nendo - SHONENDO][1][WAKAMONO] * 10. )
			     * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO];
				}
			}
		}
		// 拠出金算定対象者数用
		for( nendo = SHONENDO + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
				 = Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU];
				
				if( nendo <= 2012 )
				{
					Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
					 = ( Tuinouritu_Ashimoto[nendo - SHONENDO][1][MENJO_1_2] * ( nendo - 2002 ) + Tuinouritu_Ashimoto[nendo - SHONENDO][0][MENJO_1_2] )
					 * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2];
				}
				else
				{
					Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
					 = Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2];
				}
				if( nendo <= 2016 )
				{
					Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
					 = ( Tuinouritu_Ashimoto[nendo - SHONENDO][1][MENJO_3_4] * ( nendo - 2006 ) + Tuinouritu_Ashimoto[nendo - SHONENDO][0][MENJO_3_4] )
					   * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4];
					Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4]
					 = ( Tuinouritu_Ashimoto[nendo - SHONENDO][1][MENJO_1_4] * ( nendo - 2006 ) + Tuinouritu_Ashimoto[nendo - SHONENDO][0][MENJO_1_4] )
					   * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4];
				}
				else
				{
					Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
					 = Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4];
					Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4]
					 = Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4];
				}
				if( nendo <= 2010 )
				{
					Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
						= ( Tuinouritu_Ashimoto[nendo - SHONENDO][1][GAKUSEI] * ( nendo - 2000 ) + Tuinouritu_Ashimoto[nendo - SHONENDO][0][GAKUSEI] )
				    * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI];
				}
				else
				{
					Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
					 = Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI];
				}
				if( nenrei <= 29 )
				{
					if( nendo <= 2015 )
					{
						Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO]
						 = ( Tuinouritu_Ashimoto[nendo - SHONENDO][1][WAKAMONO] * ( nendo - 2005 ) + Tuinouritu_Ashimoto[nendo - SHONENDO][0][WAKAMONO] )
				     * Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO];
					}
					else
					{
						Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO]
						 = Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO];
					}
				}
			}
		}
		// 過年度分の作成
		// 給付費推計用
		for( nendo = SHONENDO + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				Kanendo_Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
				 = ( 1. - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
				        - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
				        - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
				        - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4]
				        - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
				        - Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO] 
					      - Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU] )
				 * Kanendo_Noufuritu_Ashimoto[nendo - SHONENDO][SUM][NOUFU];
				
				// 過年度納付率が負にならないかどうかを確認
				if( Kanendo_Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU] < 0. )
				{
					cout << "年度 " << nendo << "年齢 " << nenrei << "過年度納付率は負です。" << endl;
					Kanendo_Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU] = 0.; 
				}
				
				for( menjo_kubun = MENJO_3_4 ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					Kanendo_Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 = Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 * Kanendo_Noufuritu_Ashimoto[nendo - SHONENDO][SUM][menjo_kubun]
					 * ( 1 - Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] );
				}
			}
		}
		// 拠出金算定対象者数用
		for( nendo = SHONENDO + 1 ; nendo <= SHONENDO + 2 ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				for( menjo_kubun = NOUFU ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					if( nendo == SHONENDO + 1 && ( menjo_kubun == MENJO_1_4 || menjo_kubun == MENJO_3_4 ))
					{
						Kanendo_Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 = Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 * Kanendo_Noufuritu_Ashimoto[nendo - SHONENDO][1][menjo_kubun]
						 * ( 1. - Noufuritu_Kennin[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] );
					}
					else
					{
						Kanendo_Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 = Kanendo_Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
					}
				}
			}
		}
		// 初年度＋２年度以降の場合
		for( nendo = SHONENDO + 3 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				for( counter = 1 ; counter <= 2 ; counter++ )
				{
					Kanendo_Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
					 += ( 1. - Menjoritu[nendo - counter - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
					         - Menjoritu[nendo - counter - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
					         - Menjoritu[nendo - counter - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
					         - Menjoritu[nendo - counter - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4]
					         - Menjoritu[nendo - counter - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
					         - Menjoritu[nendo - counter - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO]
						       - Noufuritu_Hiho[nendo - counter - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU] )
					  * Kanendo_Noufuritu_Ashimoto[nendo - counter - SHONENDO][counter][NOUFU];
					
					for( menjo_kubun = MENJO_3_4 ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
					{
						Kanendo_Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 += Menjoritu[nendo - counter - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						  * Kanendo_Noufuritu_Ashimoto[nendo - counter - SHONENDO][counter][menjo_kubun]
						  * ( 1. - Noufuritu_Kennin[nendo - counter - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]);
					}
				}
				// 過年度納付率が負にならないかどうかを確認
				if( Kanendo_Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU] < 0. )
				{
					Kanendo_Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU] = 0.;
				}
			}
		}
		for( nendo = SHONENDO + 1 ; nendo <= SAISHUNENDO ; nendo++ )
		{
			for( nenrei = MIN_HIHO_NENREI ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
			  // 給付費推計用納付率
				Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 = Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
				 + Kanendo_Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU];
				for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
				{
					Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
					 += Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
				}
				if( nenrei <= MAX_HIHO_NENREI - 1 )
				{
					Menjoritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
					 = Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
					 - Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU];
					
					Tokureiritu_Gakusei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
					 = Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
					 - Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI];
				}
				else
				{
					Menjoritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU] = 0.;
					Tokureiritu_Gakusei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				}
				
				if( nenrei <= 29 )
				{
					Tokureiritu_Wakamono[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
					 = Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO]
					 - Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO];
				}
				else
				{
					Tokureiritu_Wakamono[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				}
				
				for( menjo_kubun = MENJO_3_4 ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					if( nenrei <= MAX_HIHO_NENREI - 1 )
					{
						Menjoritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 = Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 + Kanendo_Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
						 - Tuinouritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
					}
					else
					{
						Menjoritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun] = 0.;
					}
				}
				// 供出金算定対象者数用の納付率
				Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				 = Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU]
				 + Kanendo_Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][NOUFU];
				for( menjo_jokyo = ZENGAKU ; menjo_jokyo <= WAKAMONO ; menjo_jokyo++ )
				{
					Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
					 += Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_jokyo];
				}
				if( nenrei <= MAX_HIHO_NENREI - 1 )
				{
					Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
					 = Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
				   - Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU];
					
					Tokureiritu_Gakusei_S[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
					 = Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI]
					 - Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][GAKUSEI];
				}
				else
				{
					Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU] = 0.;
					Tokureiritu_Gakusei_S[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				}
				if( nenrei <= 29 )
				{
					Tokureiritu_Wakamono_S[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
					 = Menjoritu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO]
					 - Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][WAKAMONO];
				}
				else
				{
					Tokureiritu_Wakamono_S[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] = 0.;
				}
				for( menjo_kubun = MENJO_3_4 ; menjo_kubun <= MENJO_1_4 ; menjo_kubun++ )
				{
					Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 = Noufuritu_Hiho[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 + Kanendo_Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun]
					 - Tuinouritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][menjo_kubun];
				}
				// 納付率等の計が100％を超えてないかどうかをチェック
				if( Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				       + Menjoritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
				       + Menjoritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
				       + Menjoritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
				       + Menjoritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4]
				       + Tokureiritu_Gakusei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				       + Tokureiritu_Wakamono[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				     > 1. )
				{
					cout << nendo << " 年度、 " << nenrei << " 歳の納付率等の計が１００％を超えています（給付費）" << endl;
					exit( 1 );
				}
				if( Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				       + Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
				       + Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
				       + Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
				       + Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4]
				       + Tokureiritu_Gakusei_S[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				       + Tokureiritu_Wakamono_S[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
				     > 1. )
				{
					cout << nendo << " 年度、 " << nenrei << " 歳の納付率等の計が１００％を超えています（拠出金算定）" << endl;
					cout << "全額納付 " << Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] << endl;
					cout << "全額免除 " << Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU] << endl;
					cout << "３／４免除 " << Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4] << endl;
					cout << "半額免除 " << Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2] << endl;
					cout << "１／４免除 " << Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4] << endl;
					cout << "学生 " << Tokureiritu_Gakusei_S[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] << endl;
					cout << "若者 " << Tokureiritu_Wakamono_S[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] << endl;
					cout << "合計 " << Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
								+ Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][ZENGAKU]
								+ Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_3_4]
								+ Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_2]
								+ Menjoritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI][MENJO_1_4]
								+ Tokureiritu_Gakusei_S[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI]
								+ Tokureiritu_Wakamono_S[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] << endl;
					exit( 1 );
				}
			}
		}
		//後納
		for( nendo = 2012 ; nendo <= 2015 ; nendo++ )
		{
			for( nenrei = 22 ; nenrei <= MAX_HIHO_NENREI - 1 ; nenrei++ )
			{
				if( nendo == 2012 )
				{
					Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] += 0.03;
					Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] += 0.03;
				}
				if( nendo == 2013 || nendo == 2014 )
				{
					Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] += 0.02;
					Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] += 0.02;
				}
				if( nendo == 2015 )
				{
					Noufuritu_Santei[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] += 0.01;
					Noufuritu_Kyufu[nendo - SHONENDO][nenrei - MIN_HIHO_NENREI] += 0.01;
				}
			}
		}
	}
}
